diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2023-08-02 11:12:50 -0400 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2023-08-02 11:12:50 -0400 |
commit | 719ac430e7f0e338cc8d911813f25a90696aba15 (patch) | |
tree | fa062cf27437d46e780b0c33a14e9e3fdb77ced7 /src | |
parent | 591533a40c847f84e23428ab757b8822edbc2a61 (diff) |
linking+trails getAnchor+restoreView update
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/DataVizBox/DataVizBox.tsx | 13 | ||||
-rw-r--r-- | src/client/views/nodes/DataVizBox/components/Histogram.tsx | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/client/views/nodes/DataVizBox/DataVizBox.tsx b/src/client/views/nodes/DataVizBox/DataVizBox.tsx index 710c049a2..f167346de 100644 --- a/src/client/views/nodes/DataVizBox/DataVizBox.tsx +++ b/src/client/views/nodes/DataVizBox/DataVizBox.tsx @@ -68,6 +68,13 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { restoreView = (data: Doc) => { const changedView = this.dataVizView !== data.presDataVizView && (this.layoutDoc._dataVizView = data.presDataVizView); const changedAxes = this.axes.join('') !== StrListCast(data.presDataVizAxes).join('') && (this.layoutDoc._data_vizAxes = new List<string>(StrListCast(data.presDataVizAxes))); + Object.keys(this.layoutDoc).map(key => { + if (key.startsWith('histogram-title') || key.startsWith('histogramBarColors') || key.startsWith('defaultHistogramColor') + || key.startsWith('lineChart-title') || key.startsWith('pieChart-title')){ + console.log(key) + this.layoutDoc['_'+key] = data[key]; + } + }) const func = () => this._chartRenderer?.restoreView(data); if (changedView || changedAxes) { setTimeout(func, 100); @@ -88,6 +95,12 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { anchor.presDataVizView = this.dataVizView; anchor.presDataVizAxes = this.axes.length ? new List<string>(this.axes) : undefined; + Object.keys(this.layoutDoc).map(key => { + if (key.startsWith('histogram-title') || key.startsWith('histogramBarColors') || key.startsWith('defaultHistogramColor') + || key.startsWith('lineChart-title') || key.startsWith('pieChart-title')){ + anchor[key] = this.layoutDoc[key]; + } + }) this.addDocument(anchor); return anchor; diff --git a/src/client/views/nodes/DataVizBox/components/Histogram.tsx b/src/client/views/nodes/DataVizBox/components/Histogram.tsx index 740ee6e3a..c6e3b4cd1 100644 --- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx +++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx @@ -443,6 +443,7 @@ export class Histogram extends React.Component<HistogramProps> { }; render() { + this.componentDidMount(); var curSelectedBarName; var titleAccessor: any=''; if (this.props.axes.length==2) titleAccessor = StrCast(this.props.layoutDoc['histogram-title-'+this.props.axes[0]+'-'+this.props.axes[1]]); |