Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ yarn run docs

### Axis Components
- Axis :white_check_mark:
- GenomeAxis
- GenomeAxis :white_check_mark:
- DendrogramAxis


Expand Down
38 changes: 28 additions & 10 deletions examples-src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,25 @@
/>
</PlotContainer>

<h3>&lt;GenomeAxis/&gt;</h3>
<PlotContainer
:pWidth="800"
:pHeight="10"
:pMarginTop="10"
:pMarginLeft="20"
:pMarginRight="20"
:pMarginBottom="80"
>
<GenomeAxis
slot="axisBottom"
scaleKey="genome_scale"
side="bottom"
:getScale="getScale"
:getStack="getStack"
/>
</PlotContainer>


<h3>&lt;SortOptions/&gt;</h3>
<SortOptions
variable="sample_id"
Expand All @@ -229,7 +248,7 @@
<script>
import { set as d3_set } from 'd3-collection';
// Plots
import { PlotContainer, Axis } from '../src/index.js';
import { PlotContainer, Axis, GenomeAxis } from '../src/index.js';
import { StackedBarPlot, BarPlot, ScatterPlot, BoxPlot, MultiBoxPlot, TrackPlot } from '../src/index.js';

// Data
Expand Down Expand Up @@ -340,6 +359,7 @@ const ageScale = new ContinuousScale(
'Age',
[0, 100]
);
const genomeScale = new GenomeScale("genome", "Genome");

const getScale = function(scaleKey) {
switch(scaleKey) {
Expand All @@ -355,6 +375,8 @@ const getScale = function(scaleKey) {
return xyXScale;
case 'age':
return ageScale;
case 'genome_scale':
return genomeScale;
}
};

Expand All @@ -367,6 +389,8 @@ stack.push(new HistoryEvent(HistoryEvent.types.SCALE, "signature", "reset"), tru
stack.push(new HistoryEvent(HistoryEvent.types.SCALE, "y", "reset"), true);
stack.push(new HistoryEvent(HistoryEvent.types.SCALE, "x", "reset"), true);
stack.push(new HistoryEvent(HistoryEvent.types.SCALE, "age", "reset"), true);
stack.push(new HistoryEvent(HistoryEvent.types.SCALE, "genome_scale", "reset"), true);



const getStack = function() {
Expand All @@ -385,6 +409,7 @@ export default {
components: {
PlotContainer,
Axis,
GenomeAxis,
StackedBarPlot,
BarPlot,
SortOptions,
Expand All @@ -404,18 +429,11 @@ export default {
}
},
created() {
let gScale = new GenomeScale("genome", "Genome");

console.log(gScale.convertPositionToRatio("1", 2000))
console.log(gScale.convertPositionToRatioFiltered("1", 2000))

console.log(gScale.convertPositionToRatio("5", 3000))
console.log(gScale.convertPositionToRatioFiltered("5", 3000))

},
methods: {
exampleClickHandler(x, y, c) {
alert("You clicked something with data: " + JSON.stringify({x: x, y: y, c: c}));
exampleClickHandler() {
alert("You clicked something with data: " + JSON.stringify([...arguments]));
}
}
}
Expand Down
12 changes: 1 addition & 11 deletions src/components/Axis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -524,15 +524,5 @@ export default {
</script>

<style>
.vdp-axis {
position: absolute;
}

.axis-zoomed-out line, .axis-zoomed-out path {
stroke: silver;
}
.axis-zoomed-out text {
fill: silver;
}

@import '../style/axis-style.css';
</style>
Loading