aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-07-18 16:24:57 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-07-18 16:24:57 -0400
commit900efdb5c08397e53e1d00555fc6eac208eff5a1 (patch)
treeca017621e49aca38e578f6feefea063660eaf392 /src
parente7d914710dfe0aef07f35a0ea54c16adcf08600c (diff)
brushed graph has can have multiple links + still link to the correct graph for data
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/DataVizBox/DataVizBox.scss1
-rw-r--r--src/client/views/nodes/DataVizBox/components/LineChart.tsx4
-rw-r--r--src/client/views/nodes/DataVizBox/components/TableBox.tsx1
3 files changed, 4 insertions, 2 deletions
diff --git a/src/client/views/nodes/DataVizBox/DataVizBox.scss b/src/client/views/nodes/DataVizBox/DataVizBox.scss
index b3cbc89aa..5e7230271 100644
--- a/src/client/views/nodes/DataVizBox/DataVizBox.scss
+++ b/src/client/views/nodes/DataVizBox/DataVizBox.scss
@@ -1,6 +1,7 @@
.dataviz {
overflow: hidden;
height: 100%;
+ width: 100%;
.datatype-button{
margin: 0;
diff --git a/src/client/views/nodes/DataVizBox/components/LineChart.tsx b/src/client/views/nodes/DataVizBox/components/LineChart.tsx
index cb6ba6fe7..637ed0ead 100644
--- a/src/client/views/nodes/DataVizBox/components/LineChart.tsx
+++ b/src/client/views/nodes/DataVizBox/components/LineChart.tsx
@@ -1,7 +1,6 @@
import { action, computed, IReactionDisposer, observable, reaction } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
-// import d3
import * as d3 from 'd3';
import { Doc, DocListCast } from '../../../../../fields/Doc';
import { Id } from '../../../../../fields/FieldSymbols';
@@ -56,7 +55,8 @@ export class LineChart extends React.Component<LineChartProps> {
}
@computed get incomingLinks() {
return LinkManager.Instance.getAllRelatedLinks(this.props.rootDoc) // out of all links
- .filter(link => link.link_anchor_1 !== this.props.rootDoc) // get links where this chart doc is the target of the link
+ .filter(link => {
+ return link.link_anchor_1 == this.props.rootDoc.draggedFrom}) // get links where this chart doc is the target of the link
.map(link => DocCast(link.link_anchor_1)); // then return the source of the link
}
@computed get incomingSelected() {
diff --git a/src/client/views/nodes/DataVizBox/components/TableBox.tsx b/src/client/views/nodes/DataVizBox/components/TableBox.tsx
index 8c8264861..ff43f67d9 100644
--- a/src/client/views/nodes/DataVizBox/components/TableBox.tsx
+++ b/src/client/views/nodes/DataVizBox/components/TableBox.tsx
@@ -51,6 +51,7 @@ export class TableBox extends React.Component<TableBoxProps> {
const embedding = Doc.MakeEmbedding(this.props.docView?.()!.rootDoc!);
embedding._dataVizView = DataVizView.LINECHART;
embedding._data_vizAxes = new List<string>([col, col]);
+ embedding._draggedFrom = this.props.docView?.()!.rootDoc!;
embedding.annotationOn = annotationOn; //this.props.docView?.()!.rootDoc!;
return embedding;
};