File tree Expand file tree Collapse file tree 6 files changed +437
-4
lines changed Expand file tree Collapse file tree 6 files changed +437
-4
lines changed Original file line number Diff line number Diff line change 1717 - StratifiedScatterPlot
1818 - StratifiedSinaPlot
1919 - StratifiedKaplanMeierPlot
20+ - CountBarPlot
2021 - mixin
2122 - Axis
2223 - GenomeAxis
Original file line number Diff line number Diff line change 114114 slot =" axisLeft"
115115 variable =" exposure"
116116 side =" left"
117- :log =" true"
118117 :tickRotation =" -35"
119118 :getScale =" getScale"
120119 :getStack =" getStack"
124123 data =" exposures_single_data"
125124 x =" signature"
126125 y =" exposure"
127- :logY =" true"
128126 :getData =" getData"
129127 :getScale =" getScale"
130128 :clickHandler =" exampleClickHandler"
772770 />
773771 </PlotContainer >
774772
773+ <h3 >< ; CountBarPlot/> ; </h3 >
774+ <PlotContainer
775+ :pWidth =" 500"
776+ :pHeight =" 300"
777+ :pMarginTop =" 10"
778+ :pMarginLeft =" 120"
779+ :pMarginRight =" 10"
780+ :pMarginBottom =" 180"
781+ >
782+ <Axis
783+ slot =" axisLeft"
784+ variable =" num_samples"
785+ side =" left"
786+ :tickRotation =" -35"
787+ :getScale =" getScale"
788+ :getStack =" getStack"
789+ />
790+ <CountBarPlot
791+ slot =" plot"
792+ data =" exposures_data"
793+ x =" signature"
794+ y =" num_samples"
795+ o =" sample_id"
796+ :filterFunction =" countBarPlotFilterFunction"
797+ :getData =" getData"
798+ :getScale =" getScale"
799+ :clickHandler =" exampleClickHandler"
800+ />
801+ <Axis
802+ slot =" axisBottom"
803+ variable =" signature"
804+ side =" bottom"
805+ :tickRotation =" -65"
806+ :getScale =" getScale"
807+ :getStack =" getStack"
808+ />
809+ </PlotContainer >
810+
775811
776812
777813 <h3 >v-if</h3 >
@@ -848,6 +884,7 @@ import {
848884 StratifiedScatterPlot ,
849885 StratifiedSinaPlot ,
850886 StratifiedKaplanMeierPlot ,
887+ CountBarPlot ,
851888 GenomeScatterPlot ,
852889 GenomeTrackPlot ,
853890 GenomeMultiTrackPlot ,
@@ -992,6 +1029,11 @@ const sampleIdScale = new CategoricalScale(
9921029 ' Sample' ,
9931030 d3_set (exposuresData .map (el => el .sample_id )).values ()
9941031);
1032+ const numSamplesScale = new ContinuousScale (
1033+ ' num_samples' ,
1034+ ' Number of Samples' ,
1035+ [0 , d3_set (exposuresData .map (el => el .sample_id )).values ().length ]
1036+ );
9951037const exposureScale = new ContinuousScale (
9961038 ' exposure' ,
9971039 ' Exposure' ,
@@ -1144,6 +1186,8 @@ const getScale = function(scaleKey) {
11441186 switch (scaleKey) {
11451187 case ' sample_id' :
11461188 return sampleIdScale;
1189+ case ' num_samples' :
1190+ return numSamplesScale;
11471191 case ' exposure' :
11481192 return exposureScale;
11491193 case ' signature' :
@@ -1229,6 +1273,7 @@ export default {
12291273 StratifiedScatterPlot,
12301274 StratifiedSinaPlot,
12311275 StratifiedKaplanMeierPlot,
1276+ CountBarPlot,
12321277 GenomeScatterPlot,
12331278 GenomeTrackPlot,
12341279 GenomeMultiTrackPlot,
@@ -1251,6 +1296,9 @@ export default {
12511296 methods: {
12521297 exampleClickHandler () {
12531298 alert (" You clicked something with data: " + JSON .stringify ([... arguments ]));
1299+ },
1300+ countBarPlotFilterFunction (val ) {
1301+ return (val > 1 );
12541302 }
12551303 }
12561304}
Original file line number Diff line number Diff line change 11{
22 "name" : " vue-declarative-plots" ,
3- "version" : " 1.2.29 " ,
3+ "version" : " 1.2.30 " ,
44 "private" : false ,
55 "scripts" : {
66 "serve" : " vue-cli-service serve --open ./examples-src/index.js" ,
You can’t perform that action at this time.
0 commit comments