Skip to content
Snippets Groups Projects
Commit 8e41688f authored by Williams, Darius Shamar's avatar Williams, Darius Shamar
Browse files

Adding new files

parent f429e7ee
No related branches found
No related tags found
1 merge request!413Wdfn 767 - Convert cursor slider to vue
<template> <template>
<GraphBrush /> <div>
<CursorSlider />
<GraphBrush />
</div>
</template> </template>
<script> <script>
import GraphBrush from './vue-components/graph-brush.vue'; import GraphBrush from './vue-components/graph-brush.vue';
import CursorSlider from './vue-components/cursor-slider.vue';
export default { export default {
name: 'HydrographApp', name: 'HydrographApp',
components: { components: {
GraphBrush GraphBrush,
CursorSlider
} }
}; };
</script> </script>
\ No newline at end of file
<template>
<svg
class="cursor-slider-svg"
xmlns="http://www.w3.org/2000/svg"
:viewBox=viewBox
>
<g
class="cursor-slider-group"
ga-on="click"
ga-event-category="hydrograph-interaction"
ga-event-action="clickOnSlider"
>
</g>
</svg>
</template>
<script>
import {useActions, useState} from 'redux-connect-vue';
import {computed, inject, ref, watchEffect} from 'vue';
import {sliderTop} from 'd3-simple-slider';
import {createStructuredSelector} from 'reselect';
import {getGraphCursorOffset} from 'ml/selectors/hydrograph-state-selector';
import {setGraphCursorOffset} from 'ml/store/hydrograph-state';
import {getMainXScale} from './selectors/scales';
import {getMainLayout} from './selectors/layout';
export default {
name: 'CursorSlider',
setup() {
const state = useState({
layout: getMainLayout,
xAxis: getBrushXAxis,
xScale: getMainXScale,
cursorOffset: getGraphCursorOffset
});
const viewBox = computed(() => {
return `0 0 ${state.layout.value.width + state.layout.value.margin.left + state.layout.value.margin.right} 25`;
});
return {
...state,
viewBox
}
}
}
</script>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment