@icij/murmur-next 4.1.0 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/murmur.js +5841 -5839
- package/dist/lib/murmur.js.map +1 -1
- package/dist/lib/murmur.umd.cjs +28 -28
- package/dist/lib/murmur.umd.cjs.map +1 -1
- package/lib/datavisualisations/ColumnChart.vue +30 -35
- package/package.json +1 -1
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
ComponentPublicInstance,
|
|
4
|
-
computed,
|
|
5
|
-
defineComponent,
|
|
6
|
-
PropType,
|
|
7
|
-
ref,
|
|
8
|
-
watchEffect,
|
|
9
|
-
onMounted
|
|
10
|
-
} from 'vue'
|
|
2
|
+
import { ComponentPublicInstance, computed, defineComponent, PropType, ref, watch } from 'vue'
|
|
11
3
|
import { identity, iteratee, sortBy } from 'lodash'
|
|
12
4
|
import * as d3 from 'd3'
|
|
13
5
|
import { chartProps, getChartProps, useChart } from '@/composables/chart'
|
|
@@ -175,6 +167,7 @@ export default defineComponent({
|
|
|
175
167
|
const isLoaded = ref(false)
|
|
176
168
|
const {
|
|
177
169
|
loadedData,
|
|
170
|
+
mounted,
|
|
178
171
|
elementsMaxBBox,
|
|
179
172
|
d3Formatter,
|
|
180
173
|
baseHeightRatio,
|
|
@@ -339,7 +332,7 @@ export default defineComponent({
|
|
|
339
332
|
}
|
|
340
333
|
|
|
341
334
|
function update() {
|
|
342
|
-
if (!
|
|
335
|
+
if (!mounted.value) {
|
|
343
336
|
return
|
|
344
337
|
}
|
|
345
338
|
|
|
@@ -359,8 +352,9 @@ export default defineComponent({
|
|
|
359
352
|
}
|
|
360
353
|
|
|
361
354
|
function barTooltipStyle(bar: { x: number; y: number; width: number }) {
|
|
362
|
-
const
|
|
363
|
-
const
|
|
355
|
+
const { x, y } = el?.value?.getBoundingClientRect() ?? new DOMRect()
|
|
356
|
+
const top = `${y + bar.y + margin.value.top}px`
|
|
357
|
+
const left = `${x + bar.x + bar.width / 2 + margin.value.left}px`
|
|
364
358
|
return { top, left }
|
|
365
359
|
}
|
|
366
360
|
|
|
@@ -369,10 +363,9 @@ export default defineComponent({
|
|
|
369
363
|
datum.highlight || props.highlights.includes(datum[props.timeseriesKey])
|
|
370
364
|
)
|
|
371
365
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
})
|
|
366
|
+
|
|
367
|
+
watch([width, height, loadedData, mounted], update.bind(this), { immediate: true})
|
|
368
|
+
watch(() => props.socialMode, update.bind(this), { immediate: true})
|
|
376
369
|
|
|
377
370
|
return {
|
|
378
371
|
el,
|
|
@@ -449,27 +442,29 @@ export default defineComponent({
|
|
|
449
442
|
</g>
|
|
450
443
|
</g>
|
|
451
444
|
</svg>
|
|
452
|
-
<
|
|
453
|
-
<div v-
|
|
454
|
-
<div
|
|
455
|
-
<
|
|
456
|
-
<
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
<
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
445
|
+
<teleport to="body">
|
|
446
|
+
<div v-if="!noTooltips" class="column-chart__tooltips">
|
|
447
|
+
<div v-for="(bar, index) in bars" :key="index">
|
|
448
|
+
<div :style="barTooltipStyle(bar)" class="column-chart__tooltips__item">
|
|
449
|
+
<transition name="fade">
|
|
450
|
+
<div
|
|
451
|
+
v-if="shownTooltip === index"
|
|
452
|
+
class="column-chart__tooltips__item__wrapper"
|
|
453
|
+
>
|
|
454
|
+
<slot name="tooltip" v-bind="bar">
|
|
455
|
+
<h6 class="column-chart__tooltips__item__wrapper__heading mb-0">
|
|
456
|
+
{{ formatXDatum(bar.datum[timeseriesKey]) }}
|
|
457
|
+
</h6>
|
|
458
|
+
<div class="column-chart__tooltips__item__wrapper__value">
|
|
459
|
+
{{ formatYDatum(bar.datum[seriesName]) }}
|
|
460
|
+
</div>
|
|
461
|
+
</slot>
|
|
462
|
+
</div>
|
|
463
|
+
</transition>
|
|
464
|
+
</div>
|
|
470
465
|
</div>
|
|
471
466
|
</div>
|
|
472
|
-
</
|
|
467
|
+
</teleport>
|
|
473
468
|
</div>
|
|
474
469
|
</template>
|
|
475
470
|
|