Skip to content

Commit

Permalink
Use instance for edge slice width
Browse files Browse the repository at this point in the history
gotdairyya committed Feb 10, 2022
1 parent b580ad6 commit 7d4a2a6
Showing 3 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/EdgeSlices.vue
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
import { select, selectAll } from 'd3-selection';
import store from '@/store';
import {
computed, defineComponent, ref,
computed, defineComponent, getCurrentInstance, ref,
} from '@vue/composition-api';
import { extent } from 'd3-array';
import { formatLongDate, formatShortDate } from '@/lib/utils';
@@ -13,7 +13,8 @@ export default defineComponent({
setup() {
const slicedNetwork = computed(() => store.state.slicedNetwork);
const isDate = computed(() => store.state.isDate);
const svgWidth = computed(() => parseFloat(select('svg#matrix').attr('width')));
const currentInstance = getCurrentInstance();
const svgWidth = computed(() => (currentInstance !== null ? currentInstance.proxy.$vuetify.breakpoint.width - store.state.controlsWidth : 0));
const currentTime = computed(() => {
const times: { timeRanges: {[key: number]: number[] | Date[]} ; current: number ; slices: number } = { timeRanges: {}, current: 0, slices: 0 };
1 change: 1 addition & 0 deletions src/store/index.ts
Original file line number Diff line number Diff line change
@@ -78,6 +78,7 @@ const {
columnTypes: null,
slicedNetwork: [],
isDate: false,
controlsWidth: 256,
} as State,

getters: {
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -111,6 +111,7 @@ export interface State {
left: number;
};
isDate: boolean;
controlsWidth: number;
}

export type ProvenanceEventTypes =

0 comments on commit 7d4a2a6

Please sign in to comment.