diff options
| author | Sophie Zhang <sophie_zhang@brown.edu> | 2023-07-18 15:06:22 -0400 |
|---|---|---|
| committer | Sophie Zhang <sophie_zhang@brown.edu> | 2023-07-18 15:06:22 -0400 |
| commit | 40784b7265851b27e043c07e5f9038a0b29af8b7 (patch) | |
| tree | 1f9e154913820cc1cb5952a9d444d9a0eca86c29 /src/client/views/nodes/DataVizBox | |
| parent | 162ca319eae256be523f2ee75e7aae7a9a408e37 (diff) | |
| parent | 267f5d7c6a87b955c2fa2121c6db7e01cfc1c148 (diff) | |
Merge branch 'master' into sophie-ai-images
Diffstat (limited to 'src/client/views/nodes/DataVizBox')
| -rw-r--r-- | src/client/views/nodes/DataVizBox/DataVizBox.tsx | 15 | ||||
| -rw-r--r-- | src/client/views/nodes/DataVizBox/components/LineChart.tsx | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/client/views/nodes/DataVizBox/DataVizBox.tsx b/src/client/views/nodes/DataVizBox/DataVizBox.tsx index baa45e278..d548ab9f1 100644 --- a/src/client/views/nodes/DataVizBox/DataVizBox.tsx +++ b/src/client/views/nodes/DataVizBox/DataVizBox.tsx @@ -71,13 +71,14 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { }; getAnchor = (addAsAnnotation?: boolean, pinProps?: PinProps) => { - const anchor = - this._chartRenderer?.getAnchor(pinProps) ?? - Docs.Create.DataVizConfigDocument({ - // when we clear selection -> we should have it so chartBox getAnchor returns undefined - // this is for when we want the whole doc (so when the chartBox getAnchor returns without a marker) - /*put in some options*/ - }); + const anchor = !pinProps + ? this.rootDoc + : this._chartRenderer?.getAnchor(pinProps) ?? + Docs.Create.ConfigDocument({ + // when we clear selection -> we should have it so chartBox getAnchor returns undefined + // this is for when we want the whole doc (so when the chartBox getAnchor returns without a marker) + /*put in some options*/ + }); anchor.presDataVizView = this.dataVizView; anchor.presDataVizAxes = this.axes.length ? new List<string>(this.axes) : undefined; diff --git a/src/client/views/nodes/DataVizBox/components/LineChart.tsx b/src/client/views/nodes/DataVizBox/components/LineChart.tsx index 661061d51..6b564b0c9 100644 --- a/src/client/views/nodes/DataVizBox/components/LineChart.tsx +++ b/src/client/views/nodes/DataVizBox/components/LineChart.tsx @@ -163,7 +163,7 @@ export class LineChart extends React.Component<LineChartProps> { // create a document anchor that stores whatever is needed to reconstruct the viewing state (selection,zoom,etc) getAnchor = (pinProps?: PinProps) => { - const anchor = Docs.Create.LineChartConfigDocument({ + const anchor = Docs.Create.ConfigDocument({ // title: 'line doc selection' + this._currSelected?.x, }); |
