Skip to content

Commit 9916782

Browse files
committed
Add multi rect plot
1 parent 8fd7eb8 commit 9916782

13 files changed

+605
-21
lines changed

examples-src/App.vue

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,42 @@
906906
/>
907907
</PlotContainer>
908908

909+
<h3>&lt;MultiDataRectPlot/&gt; with value labels</h3>
910+
<PlotContainer
911+
:pWidth="200"
912+
:pHeight="80"
913+
:pMarginTop="5"
914+
:pMarginLeft="140"
915+
:pMarginRight="40"
916+
:pMarginBottom="50"
917+
:showDownloadButton="true"
918+
>
919+
<Axis
920+
slot="axisLeft"
921+
variable="multi_rect_plot_scale"
922+
side="left"
923+
:disableBrushing="true"
924+
:tickRotation="0"
925+
:getScale="getScale"
926+
:getStack="getStack"
927+
/>
928+
<MultiDataRectPlot
929+
slot="plot"
930+
:dataArray="['clinical_data', 'clinical_data']"
931+
:cArray="['age', 'sex']"
932+
z="sample_id"
933+
o="SA569952"
934+
:disableText="false"
935+
:disableTooltip="true"
936+
:rectSize="30"
937+
:textSize="14"
938+
textColor="#2c3e50"
939+
:getData="getData"
940+
:getScale="getScale"
941+
:clickHandler="exampleClickHandler"
942+
/>
943+
</PlotContainer>
944+
909945
<h3>&lt;StratifiedKaplanMeierPlot/&gt;</h3>
910946
<PlotContainer
911947
:pWidth="500"
@@ -1055,6 +1091,7 @@ import {
10551091
TrackPlot,
10561092
RectPlot,
10571093
MultiTrackPlot,
1094+
MultiDataRectPlot,
10581095
MultiDataTrackPlot,
10591096
HierarchicalMultiTrackPlot,
10601097
StratifiedBoxPlot,
@@ -1360,6 +1397,12 @@ const survivalTimeScale = new ContinuousScale(
13601397
[0, 4680]
13611398
);
13621399
1400+
const multiRectPlotScale = new CategoricalScale(
1401+
'multi_rect_plot_scale',
1402+
'Variable',
1403+
["Age", "Sex"]
1404+
);
1405+
13631406
const survivalPatientScale = new CategoricalScale(
13641407
'survival_patient',
13651408
'Patient',
@@ -1417,6 +1460,8 @@ const getScale = function(scaleKey) {
14171460
return survivalTimeScale;
14181461
case 'survival_patient':
14191462
return survivalPatientScale;
1463+
case 'multi_rect_plot_scale':
1464+
return multiRectPlotScale;
14201465
}
14211466
};
14221467
@@ -1455,6 +1500,8 @@ export default {
14551500
TrackPlot,
14561501
RectPlot,
14571502
MultiTrackPlot,
1503+
MultiDataRectPlot,
1504+
MultiDataTrackPlot,
14581505
HierarchicalMultiTrackPlot,
14591506
StratifiedBoxPlot,
14601507
DoubleStratifiedBoxPlot,

src/components/plots/BarPlot.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import { scaleBand as d3_scaleBand, scaleLinear as d3_scaleLinear, scaleLog as d
5959
import { select as d3_select, create as d3_create } from 'd3-selection';
6060
import { mouse as d3_mouse, event as d3_event } from 'd3';
6161
import debounce from 'lodash/debounce';
62-
import { TOOLTIP_DEBOUNCE, BAR_MARGIN_X_DEFAULT, BAR_WIDTH_MIN } from './../../constants.js';
62+
import { TOOLTIP_DEBOUNCE, BAR_MARGIN_DEFAULT, BAR_WIDTH_MIN } from './../../constants.js';
6363
import { getRetinaRatio } from './../../helpers.js';
6464
6565
import AbstractScale from './../../scales/AbstractScale.js';
@@ -107,7 +107,7 @@ export default {
107107
},
108108
'barMarginX': {
109109
type: Number,
110-
default: BAR_MARGIN_X_DEFAULT
110+
default: BAR_MARGIN_DEFAULT
111111
},
112112
'logY': {
113113
type: Boolean,

src/components/plots/CountBarPlot.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import { scaleBand as d3_scaleBand, scaleLinear as d3_scaleLinear, scaleLog as d
5959
import { select as d3_select, create as d3_create } from 'd3-selection';
6060
import { mouse as d3_mouse, event as d3_event } from 'd3';
6161
import debounce from 'lodash/debounce';
62-
import { TOOLTIP_DEBOUNCE, BAR_MARGIN_X_DEFAULT, BAR_WIDTH_MIN } from './../../constants.js';
62+
import { TOOLTIP_DEBOUNCE, BAR_MARGIN_DEFAULT, BAR_WIDTH_MIN } from './../../constants.js';
6363
import { getRetinaRatio } from './../../helpers.js';
6464
6565
import AbstractScale from './../../scales/AbstractScale.js';
@@ -117,7 +117,7 @@ export default {
117117
},
118118
'barMarginX': {
119119
type: Number,
120-
default: BAR_MARGIN_X_DEFAULT
120+
default: BAR_MARGIN_DEFAULT
121121
},
122122
'logY': {
123123
type: Boolean,

src/components/plots/GenomeMultiTrackPlot.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ import { scaleLinear as d3_scaleLinear, scaleBand as d3_scaleBand } from 'd3-sca
6666
import { select as d3_select } from 'd3-selection';
6767
import { mouse as d3_mouse, event as d3_event } from 'd3';
6868
import debounce from 'lodash/debounce';
69-
import { TOOLTIP_DEBOUNCE, BAR_HEIGHT_MIN, BAR_MARGIN_Y_DEFAULT } from './../../constants.js';
69+
import { TOOLTIP_DEBOUNCE, BAR_HEIGHT_MIN, BAR_MARGIN_DEFAULT } from './../../constants.js';
7070
import { getDelaunay } from './../../helpers.js';
7171
7272
import AbstractScale from './../../scales/AbstractScale.js';
@@ -150,7 +150,7 @@ export default {
150150
},
151151
'barMarginY': {
152152
type: Number,
153-
default: BAR_MARGIN_Y_DEFAULT
153+
default: BAR_MARGIN_DEFAULT
154154
}
155155
},
156156
data() {

src/components/plots/HierarchicalMultiTrackPlot.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ import { scaleBand as d3_scaleBand } from 'd3-scale';
8282
import { select as d3_select, create as d3_create } from 'd3-selection';
8383
import { mouse as d3_mouse, event as d3_event } from 'd3';
8484
import debounce from 'lodash/debounce';
85-
import { TOOLTIP_DEBOUNCE, BAR_WIDTH_MIN, BAR_HEIGHT_MIN, BAR_MARGIN_X_DEFAULT, BAR_MARGIN_Y_DEFAULT } from './../../constants.js';
85+
import { TOOLTIP_DEBOUNCE, BAR_WIDTH_MIN, BAR_HEIGHT_MIN, BAR_MARGIN_DEFAULT } from './../../constants.js';
8686
import { getRetinaRatio, filterHierarchy } from './../../helpers.js';
8787
8888
@@ -137,11 +137,11 @@ export default {
137137
},
138138
'barMarginX': {
139139
type: Number,
140-
default: BAR_MARGIN_X_DEFAULT
140+
default: BAR_MARGIN_DEFAULT
141141
},
142142
'barMarginY': {
143143
type: Number,
144-
default: BAR_MARGIN_Y_DEFAULT
144+
default: BAR_MARGIN_DEFAULT
145145
}
146146
},
147147
data() {

0 commit comments

Comments
 (0)