Skip to content

Commit

Permalink
Implement StratifiedBoxPlot
Browse files Browse the repository at this point in the history
  • Loading branch information
keller-mark committed Nov 11, 2018
1 parent 2e66511 commit 9997d30
Show file tree
Hide file tree
Showing 5 changed files with 535 additions and 2 deletions.
50 changes: 50 additions & 0 deletions examples-src/App.vue
Expand Up @@ -277,6 +277,46 @@
/>
</PlotContainer>

<h3>&lt;StratifiedBoxPlot/&gt;</h3>
<PlotContainer
:pWidth="500"
:pHeight="300"
:pMarginTop="10"
:pMarginLeft="120"
:pMarginRight="10"
:pMarginBottom="180"
>
<Axis
slot="axisLeft"
variable="exposure"
side="left"
:tickRotation="-35"
:getScale="getScale"
:getStack="getStack"
/>
<StratifiedBoxPlot
slot="plot"
data="exposures_data"
variable="COSMIC 1"
s="clinical_data"
x="sex"
y="exposure"
o="sample_id"
:getData="getData"
:getScale="getScale"
:clickHandler="exampleClickHandler"
:drawOutliers="true"
/>
<Axis
slot="axisBottom"
variable="sex"
side="bottom"
:tickRotation="-65"
:getScale="getScale"
:getStack="getStack"
/>
</PlotContainer>

<h3>&lt;TrackPlot/&gt;</h3>
<PlotContainer
:pWidth="700"
Expand Down Expand Up @@ -566,6 +606,7 @@ import {
TrackPlot,
MultiTrackPlot,
HierarchicalMultiTrackPlot,
StratifiedBoxPlot,
GenomeScatterPlot,
GenomeTrackPlot,
GenomeMultiTrackPlot,
Expand Down Expand Up @@ -717,6 +758,12 @@ const ageScale = new ContinuousScale(
'Age',
[0, 100]
);
const sexScale = new CategoricalScale(
'sex',
'Sex',
["male", "female"],
["Male", "Female"]
);
const genomeScale = new GenomeScale("genome", "Genome");
const SBS_96_CATEGORIES = [
'A[C>A]A', 'A[C>A]C', 'A[C>A]G', 'A[C>A]T',
Expand Down Expand Up @@ -821,6 +868,8 @@ const getScale = function(scaleKey) {
return xyXScale;
case 'age':
return ageScale;
case 'sex':
return sexScale;
case 'genome':
return genomeScale;
case 'cat':
Expand Down Expand Up @@ -881,6 +930,7 @@ export default {
TrackPlot,
MultiTrackPlot,
HierarchicalMultiTrackPlot,
StratifiedBoxPlot,
GenomeScatterPlot,
GenomeTrackPlot,
GenomeMultiTrackPlot,
Expand Down
2 changes: 1 addition & 1 deletion examples-src/data/clinical_data.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "vue-declarative-plots",
"version": "1.2.6",
"version": "1.2.7",
"private": false,
"scripts": {
"serve": "vue-cli-service serve --open ./examples-src/index.js",
Expand Down

0 comments on commit 9997d30

Please sign in to comment.