File tree Expand file tree Collapse file tree 1 file changed +29
-4
lines changed
Expand file tree Collapse file tree 1 file changed +29
-4
lines changed Original file line number Diff line number Diff line change 3535 options: {
3636 type: Object ,
3737 default : () => {}
38+ },
39+ debug: {
40+ type: Boolean ,
41+ default: false
3842 }
3943 },
4044 mounted () {
45+ if (this .debug ) {
46+ console .log (' mounted' )
47+ }
4148 this .$nextTick (() => {
4249 this .hg = L .control .heightgraph ({... this .options ,... {
4350 // merges quick settings with options if they are defined
4855 })
4956 },
5057 beforeDestroy () {
58+ if (this .debug ) {
59+ console .log (' beforeDestroy' )
60+ }
5161 if (this .hg ) {
5262 this .hg .remove ()
5363 }
5464 },
5565 methods: {
5666 updateGraph () {
67+ if (this .debug ) {
68+ console .log (' updateGraph' )
69+ }
5770 if (this .hg ) {
5871 this .hg .remove ()
5972 }
6073 const map = this .$parent .mapObject
61- this .hg .addTo (map)
62- let p = Object .keys (this .availableParsers ).includes (this .parser ) ? this .parser : ' normal'
63- let dataCollections = this .availableParsers [p](this .data )
64- this .hg .addData (dataCollections)
74+ let dataCollections = null ;
75+ try {
76+ this .hg .addTo (map)
77+ let p = Object .keys (this .availableParsers ).includes (this .parser ) ? this .parser : ' normal'
78+
79+ dataCollections = this .availableParsers [p](this .data )
80+ this .hg .addData (dataCollections)
81+ } catch (err) {
82+ console .log (' Error in updateGraph: ' )
83+ console .log (err)
84+ console .log (' data' , this .data )
85+ console .log (' dataCollections' , dataCollections)
86+ }
6587 }
6688 },
6789 watch: {
6890 data : function () {
91+ if (this .debug ) {
92+ console .log (' watch.data' )
93+ }
6994 if (! this .data && this .hg ) {
7095 this .hg .remove ()
7196 } else {
You can’t perform that action at this time.
0 commit comments