diff options
Diffstat (limited to 'src/client/views/nodes/DataVizBox/DataVizBox.tsx')
-rw-r--r-- | src/client/views/nodes/DataVizBox/DataVizBox.tsx | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/client/views/nodes/DataVizBox/DataVizBox.tsx b/src/client/views/nodes/DataVizBox/DataVizBox.tsx index 944468a43..db677ff61 100644 --- a/src/client/views/nodes/DataVizBox/DataVizBox.tsx +++ b/src/client/views/nodes/DataVizBox/DataVizBox.tsx @@ -68,16 +68,29 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { // use dataview to restore part of it and then pass on the rest to the chartbox // pseudocode - setTimeout(() => this._chartBox?.scrollFocus(doc, smooth)); /* smooth parameter true = do animations */ - return 0; + return this._chartBox?.scrollFocus(doc, smooth); }; - getAnchor() { + getAnchor = () => { + // TODO: nda - look into DocumentButtonBar and DocumentLinksButton + + /* + if nothing selected: + return this.rootDoc + this part does not specify view type (doesn't change type when following the link) + + // this slightly diff than the stuff below: + below part returns an anchor that specifies the viewtype for the whole doc and nothing else + + */ + // store whatever information would allow me to reselect the same thing (store parameters I would pass to get the exact same element) const anchor = // this._COMPONENTNAME._getAnchor() ?? this._chartBox?._getAnchor() ?? Docs.Create.TextanchorDocument({ + // 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*/ }); @@ -86,7 +99,7 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { this.addDocument(anchor); return anchor; // have some other function in code that - } + }; constructor(props: any) { super(props); if (!this.rootDoc._dataVizView) { @@ -119,6 +132,7 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { } componentDidMount() { + this.props.setContentView?.(this); // this.createPairs(); this.fetchData(); } |