@icij/murmur-next 4.0.0 → 4.0.3
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/README.md +15 -19
- package/dist/lib/components/AccordionStep.vue.d.ts +79 -0
- package/dist/lib/components/AccordionWrapper.vue.d.ts +33 -0
- package/dist/lib/components/ActiveTextTruncate.vue.d.ts +101 -0
- package/dist/lib/components/AdvancedLinkForm.vue.d.ts +168 -0
- package/dist/lib/components/Brand.vue.d.ts +55 -0
- package/dist/lib/components/BrandExpansion.vue.d.ts +105 -0
- package/dist/lib/components/ConfirmButton.vue.d.ts +158 -0
- package/dist/lib/components/ContentPlaceholder.vue.d.ts +44 -0
- package/dist/lib/components/CustomPagination.vue.d.ts +130 -0
- package/dist/lib/components/DigitsInput.vue.d.ts +66 -0
- package/dist/lib/components/DonateForm.vue.d.ts +46 -0
- package/dist/lib/components/EmbedForm.vue.d.ts +121 -0
- package/dist/lib/components/EmbeddableFooter.vue.d.ts +103 -0
- package/dist/lib/components/FollowUsPopover.vue.d.ts +16 -0
- package/dist/lib/components/GenericFooter.vue.d.ts +47 -0
- package/dist/lib/components/GenericHeader.vue.d.ts +928 -0
- package/dist/lib/components/HapticCopy.vue.d.ts +156 -0
- package/dist/lib/components/ImddbHeader.vue.d.ts +960 -0
- package/dist/lib/components/OrdinalLegend.vue.d.ts +87 -0
- package/dist/lib/components/RangePicker.vue.d.ts +196 -0
- package/dist/lib/components/ResponsiveIframe.vue.d.ts +45 -0
- package/dist/lib/components/ScaleLegend.vue.d.ts +101 -0
- package/dist/lib/components/SecretInput.vue.d.ts +99 -0
- package/dist/lib/components/SelectableDropdown.vue.d.ts +210 -0
- package/dist/lib/components/SharingOptions.vue.d.ts +153 -0
- package/dist/lib/components/SharingOptionsLink.vue.d.ts +200 -0
- package/dist/lib/components/SignUpForm.vue.d.ts +141 -0
- package/dist/lib/components/SlideUpDown.vue.d.ts +74 -0
- package/dist/lib/components/TexturedDeck.vue.d.ts +89 -0
- package/dist/lib/components/TinyPagination.vue.d.ts +188 -0
- package/dist/lib/composables/chart.d.ts +48 -0
- package/dist/lib/composables/resizeObserver.d.ts +22 -0
- package/dist/lib/composables/sendEmail.d.ts +6 -0
- package/dist/lib/config.d.ts +19 -0
- package/dist/lib/config.default.d.ts +34 -0
- package/dist/lib/datavisualisations/BarChart.vue.d.ts +234 -0
- package/dist/lib/datavisualisations/ColumnChart.vue.d.ts +404 -0
- package/dist/lib/datavisualisations/LineChart.vue.d.ts +200 -0
- package/dist/lib/datavisualisations/StackedBarChart.vue.d.ts +342 -0
- package/dist/lib/datavisualisations/StackedColumnChart.vue.d.ts +412 -0
- package/dist/lib/enums.d.ts +32 -0
- package/dist/lib/i18n.d.ts +4 -0
- package/dist/lib/keys.d.ts +2 -0
- package/dist/lib/main.d.ts +52 -0
- package/dist/lib/maps/ChoroplethMap.vue.d.ts +460 -0
- package/dist/lib/maps/ChoroplethMapAnnotation.vue.d.ts +188 -0
- package/dist/lib/maps/SymbolMap.vue.d.ts +276 -0
- package/dist/lib/murmur.css +1 -0
- package/dist/lib/murmur.js +44661 -0
- package/dist/lib/murmur.js.map +1 -0
- package/dist/lib/murmur.umd.cjs +837 -0
- package/dist/lib/murmur.umd.cjs.map +1 -0
- package/dist/lib/types.d.ts +44 -0
- package/dist/lib/utils/animation.d.ts +8 -0
- package/dist/lib/utils/assets.d.ts +2 -0
- package/dist/lib/utils/clipboard.d.ts +2 -0
- package/dist/lib/utils/iframe-resizer.d.ts +10 -0
- package/dist/lib/utils/placeholder.d.ts +12 -0
- package/dist/lib/utils/placeholderTypes.d.ts +18 -0
- package/dist/lib/utils/strings.d.ts +1 -0
- package/lib/components/AccordionStep.vue +53 -42
- package/lib/components/AccordionWrapper.vue +25 -24
- package/lib/components/ActiveTextTruncate.vue +44 -22
- package/lib/components/AdvancedLinkForm.vue +96 -46
- package/lib/components/Brand.vue +30 -23
- package/lib/components/BrandExpansion.vue +12 -3
- package/lib/components/ConfirmButton.vue +30 -26
- package/lib/components/ContentPlaceholder.vue +11 -7
- package/lib/components/CustomPagination.vue +50 -32
- package/lib/components/DigitsInput.vue +64 -60
- package/lib/components/DonateForm.vue +112 -83
- package/lib/components/EmbedForm.vue +37 -21
- package/lib/components/EmbeddableFooter.vue +14 -10
- package/lib/components/FollowUsPopover.vue +42 -40
- package/lib/components/GenericFooter.vue +98 -23
- package/lib/components/GenericHeader.vue +66 -29
- package/lib/components/HapticCopy.vue +41 -29
- package/lib/components/ImddbHeader.vue +113 -92
- package/lib/components/OrdinalLegend.vue +43 -20
- package/lib/components/RangePicker.vue +63 -42
- package/lib/components/ResponsiveIframe.vue +9 -2
- package/lib/components/ScaleLegend.vue +56 -18
- package/lib/components/SecretInput.vue +7 -8
- package/lib/components/SelectableDropdown.vue +119 -74
- package/lib/components/SharingOptions.vue +93 -36
- package/lib/components/SharingOptionsLink.vue +11 -5
- package/lib/components/SignUpForm.vue +44 -23
- package/lib/components/SlideUpDown.vue +7 -2
- package/lib/components/TexturedDeck.vue +24 -14
- package/lib/components/TinyPagination.vue +35 -22
- package/lib/composables/chart.ts +174 -157
- package/lib/composables/resizeObserver.ts +29 -29
- package/lib/composables/sendEmail.ts +53 -42
- package/lib/config.default.ts +17 -10
- package/lib/config.ts +34 -27
- package/lib/datavisualisations/BarChart.vue +48 -42
- package/lib/datavisualisations/ColumnChart.vue +133 -89
- package/lib/datavisualisations/LineChart.vue +79 -57
- package/lib/datavisualisations/StackedBarChart.vue +116 -68
- package/lib/datavisualisations/StackedColumnChart.vue +196 -115
- package/lib/enums.ts +25 -15
- package/lib/i18n.ts +3 -3
- package/lib/keys.ts +2 -2
- package/lib/main.ts +14 -10
- package/lib/maps/ChoroplethMap.vue +299 -160
- package/lib/maps/ChoroplethMapAnnotation.vue +29 -18
- package/lib/maps/SymbolMap.vue +194 -123
- package/lib/shims-bootstrap-vue.d.ts +1 -1
- package/lib/shims-vue.d.ts +3 -3
- package/lib/styles/functions.scss +10 -6
- package/lib/styles/lib.scss +2 -4
- package/lib/styles/mixins.scss +8 -8
- package/lib/styles/utilities.scss +1 -1
- package/lib/styles/variables.scss +24 -18
- package/lib/types.ts +26 -10
- package/lib/utils/animation.ts +4 -4
- package/lib/utils/assets.ts +31 -28
- package/lib/utils/clipboard.ts +16 -10
- package/lib/utils/iframe-resizer.ts +18 -13
- package/lib/utils/placeholder.ts +54 -23
- package/lib/utils/placeholderTypes.ts +3 -3
- package/package.json +21 -2
- package/.github/workflows/deploy-github-pages.yaml +0 -50
- package/.storybook/app.scss +0 -14
- package/.storybook/doc_variables.scss +0 -20
- package/.storybook/main.ts +0 -35
- package/.storybook/preview-head.html +0 -2
- package/.storybook/preview.ts +0 -32
- package/deploy.js +0 -15
- package/docs/components/ApiTable.vue +0 -171
- package/docs/components/App.vue +0 -146
- package/docs/components/CollapsibleBlock.vue +0 -122
- package/docs/components/DocsHeader.vue +0 -68
- package/docs/components/DocsMenu.vue +0 -201
- package/docs/components/DocsMenuSection.vue +0 -109
- package/docs/components/EditLink.vue +0 -49
- package/docs/components/OutboundLink.vue +0 -13
- package/docs/components/PalettePresenter.vue +0 -96
- package/docs/components/RepositoryLink.vue +0 -28
- package/docs/components/SampleCard.vue +0 -119
- package/docs/main.js +0 -42
- package/docs/pages/components/accordion/doc.md +0 -96
- package/docs/pages/components/active-text-truncate/doc.md +0 -44
- package/docs/pages/components/advanced-link-form/doc.md +0 -105
- package/docs/pages/components/brand/doc.md +0 -30
- package/docs/pages/components/brand-expansion/doc.md +0 -70
- package/docs/pages/components/confirm-button/doc.md +0 -91
- package/docs/pages/components/content-placeholder/doc.md +0 -16
- package/docs/pages/components/custom-pagination/doc.md +0 -61
- package/docs/pages/components/digits-input/doc.md +0 -28
- package/docs/pages/components/donate-form/doc.md +0 -20
- package/docs/pages/components/embed-form/doc.md +0 -22
- package/docs/pages/components/embeddable-footer/doc.md +0 -60
- package/docs/pages/components/follow-us-popover/doc.md +0 -5
- package/docs/pages/components/generic-footer/doc.md +0 -21
- package/docs/pages/components/generic-header/doc.md +0 -24
- package/docs/pages/components/haptic-copy/doc.md +0 -27
- package/docs/pages/components/imddb-header/doc.md +0 -23
- package/docs/pages/components/ordinal-legend/doc.md +0 -44
- package/docs/pages/components/range-picker/doc.md +0 -86
- package/docs/pages/components/responsive-iframe/doc.md +0 -13
- package/docs/pages/components/scale-legend/doc.md +0 -65
- package/docs/pages/components/secret-input/doc.md +0 -12
- package/docs/pages/components/selectable-dropdown/doc.md +0 -156
- package/docs/pages/components/sharing-options/doc.md +0 -13
- package/docs/pages/components/sharing-options-link/doc.md +0 -36
- package/docs/pages/components/sign-up-form/doc.md +0 -13
- package/docs/pages/components/slide-up-down/doc.md +0 -28
- package/docs/pages/components/textured-deck/doc.md +0 -78
- package/docs/pages/components/tiny-pagination/doc.md +0 -92
- package/docs/pages/datavisualisation/bars/doc.md +0 -110
- package/docs/pages/datavisualisation/columns/doc.md +0 -165
- package/docs/pages/datavisualisation/lines/doc.md +0 -139
- package/docs/pages/datavisualisation/stacked-bar/doc.md +0 -160
- package/docs/pages/datavisualisation/stacked-column/doc.md +0 -191
- package/docs/pages/getting-started/about-icij/doc.md +0 -13
- package/docs/pages/getting-started/custom-bootstrap/doc.md +0 -36
- package/docs/pages/getting-started/installation-guide/doc.md +0 -59
- package/docs/pages/getting-started/internationalization/doc.md +0 -74
- package/docs/pages/maps/choropleth-map/doc.md +0 -420
- package/docs/pages/maps/choropleth-map-annotation/doc.md +0 -373
- package/docs/pages/maps/symbol-map/doc.md +0 -203
- package/docs/pages/structure/breakpoints/doc.md +0 -3
- package/docs/pages/structure/grid/doc.md +0 -3
- package/docs/pages/utilities/assets/doc.md +0 -138
- package/docs/pages/utilities/config/doc.md +0 -52
- package/docs/pages/utilities/iframes/doc.md +0 -3
- package/docs/pages/visual/colors/doc.md +0 -31
- package/docs/pages/visual/iconography/doc.md +0 -56
- package/docs/pages/visual/states/doc.md +0 -77
- package/docs/pages/visual/themes/doc.md +0 -3
- package/docs/pages/visual/typography/doc.md +0 -71
- package/docs/routes.js +0 -25
- package/docs/store/index.js +0 -21
- package/docs/styles/app.scss +0 -36
- package/docs/styles/variables.scss +0 -20
- package/loaders/highlight-loader.js +0 -13
- package/loaders/markdown-loader.js +0 -91
- package/loaders/metadata-loader.js +0 -18
- package/loaders/sass-extract-loader.js +0 -14
- package/loaders/vue-docgen-loader.js +0 -14
- package/plugins/MdPluginTypes.ts +0 -10
- package/plugins/docs.ts +0 -50
- package/plugins/front-matter.ts +0 -36
- package/plugins/highlight.ts +0 -27
- package/plugins/markdown-it/api-table.ts +0 -25
- package/plugins/markdown-it/sample-card.ts +0 -31
- package/plugins/plugin-delete.ts +0 -47
- package/plugins/plugin-docgen.ts +0 -23
- package/plugins/sass-vars.ts +0 -25
- package/plugins/vue-docgen.ts +0 -29
- package/public/android-chrome-192x192.png +0 -0
- package/public/android-chrome-512x512.png +0 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/assets/img/arrow-bottom.svg +0 -3
- package/public/assets/img/texture-brick-black.jpg +0 -0
- package/public/assets/img/texture-brick.jpg +0 -0
- package/public/assets/img/texture-carbon-black.jpg +0 -0
- package/public/assets/img/texture-carbon.jpg +0 -0
- package/public/assets/img/texture-crack-black.jpg +0 -0
- package/public/assets/img/texture-crack.jpg +0 -0
- package/public/assets/img/texture-rock-black.jpg +0 -0
- package/public/assets/img/texture-rock.jpg +0 -0
- package/public/assets/img/texture-sand-black.jpg +0 -0
- package/public/assets/img/texture-sand.jpg +0 -0
- package/public/assets/img/texture-silk-black.jpg +0 -0
- package/public/assets/img/texture-silk.jpg +0 -0
- package/public/assets/topojson/france-departments.json +0 -1
- package/public/assets/topojson/paris-arrondissements.json +0 -1
- package/public/assets/topojson/world-countries-sans-antarctica.json +0 -1
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/site.webmanifest +0 -1
- package/stories/assets/code-brackets.svg +0 -1
- package/stories/assets/colors.svg +0 -1
- package/stories/assets/comments.svg +0 -1
- package/stories/assets/direction.svg +0 -1
- package/stories/assets/flow.svg +0 -1
- package/stories/assets/plugin.svg +0 -1
- package/stories/assets/repo.svg +0 -1
- package/stories/assets/stackalt.svg +0 -1
- package/stories/getting-started/about-icij.mdx +0 -14
- package/stories/getting-started/custom-bootstrap.mdx +0 -23
- package/stories/getting-started/installation-guide.mdx +0 -62
- package/stories/getting-started/internationalization.mdx +0 -63
- package/stories/murmur/components/AccordionStep.stories.ts +0 -33
- package/stories/murmur/components/AccordionWrapper.stories.ts +0 -69
- package/stories/murmur/components/ActiveTextTruncate.stories.ts +0 -32
- package/stories/murmur/components/AdvancedLinkForm.stories.ts +0 -77
- package/stories/murmur/components/Brand.stories.ts +0 -30
- package/stories/murmur/components/BrandExpansion.stories.ts +0 -41
- package/stories/murmur/components/ConfirmButton.stories.ts +0 -40
- package/stories/murmur/components/ContentPlaceholder.stories.ts +0 -41
- package/stories/murmur/components/CustomPagination.stories.ts +0 -42
- package/stories/murmur/components/DigitsInput.stories.ts +0 -29
- package/stories/murmur/components/DonateForm.stories.ts +0 -29
- package/stories/murmur/components/EmbedForm.stories.ts +0 -35
- package/stories/murmur/components/EmbeddableFooter.stories.ts +0 -59
- package/stories/murmur/components/FollowUsPopover.stories.ts +0 -24
- package/stories/murmur/components/GenericFooter.stories.ts +0 -27
- package/stories/murmur/components/GenericHeader.stories.ts +0 -27
- package/stories/murmur/components/HapticCopy.stories.ts +0 -40
- package/stories/murmur/components/ImddbHeader.stories.ts +0 -27
- package/stories/murmur/components/OrdinalLegend.stories.ts +0 -49
- package/stories/murmur/components/RangePicker.stories.ts +0 -98
- package/stories/murmur/components/ResponsiveIframe.stories.ts +0 -24
- package/stories/murmur/components/ScaleLegend.stories.ts +0 -65
- package/stories/murmur/components/SecretInput.stories.ts +0 -60
- package/stories/murmur/components/SelectableDropdown.stories.ts +0 -143
- package/stories/murmur/components/SharingOptions.stories.ts +0 -32
- package/stories/murmur/components/SharingOptionsLink.stories.ts +0 -53
- package/stories/murmur/components/SignUpForm.stories.ts +0 -51
- package/stories/murmur/components/SlideUpDown.stories.ts +0 -32
- package/stories/murmur/components/TexturedDeck.stories.ts +0 -83
- package/stories/murmur/components/TinyPagination.stories.ts +0 -65
- package/stories/murmur/datavisualisations/BarChart.stories.ts +0 -54
- package/stories/murmur/datavisualisations/ColumnChart.stories.ts +0 -88
- package/stories/murmur/datavisualisations/LineChart.stories.ts +0 -139
- package/stories/murmur/datavisualisations/StackedBarChart.stories.ts +0 -199
- package/stories/murmur/datavisualisations/StackedColumnChart.stories.ts +0 -136
- package/stories/murmur/decorators.ts +0 -108
- package/stories/murmur/maps/ChoroplethMap.stories.ts +0 -440
- package/stories/murmur/maps/ChoroplethMapAnnotation.stories.ts +0 -26
- package/stories/murmur/maps/SymbolMap.stories.ts +0 -24
- package/stories/murmur/utils.ts +0 -7
- package/tests/unit/components/AccordionStep.spec.ts +0 -157
- package/tests/unit/components/AccordionWrapper.spec.ts +0 -57
- package/tests/unit/components/ActiveTextTruncate.spec.js +0 -30
- package/tests/unit/components/AdvancedLinkForm.spec.js +0 -124
- package/tests/unit/components/Brand.spec.js +0 -50
- package/tests/unit/components/ContentPlaceholder.spec.js +0 -29
- package/tests/unit/components/CustomPagination.spec.js +0 -72
- package/tests/unit/components/DigitsInput.spec.ts +0 -157
- package/tests/unit/components/DonateForm.spec.js +0 -149
- package/tests/unit/components/EmbedForm.spec.js +0 -108
- package/tests/unit/components/EmbeddableFooter.spec.js +0 -11
- package/tests/unit/components/Fa.spec.js +0 -18
- package/tests/unit/components/FollowUsPopover.spec.js +0 -29
- package/tests/unit/components/GenericFooter.spec.js +0 -29
- package/tests/unit/components/GenericHeader.spec.js +0 -104
- package/tests/unit/components/HapticCopy.spec.js +0 -123
- package/tests/unit/components/ImddbHeader.spec.js +0 -96
- package/tests/unit/components/OrdinalLegend.spec.js +0 -120
- package/tests/unit/components/RangePicker.spec.ts +0 -87
- package/tests/unit/components/ResponsiveIframe.spec.js +0 -20
- package/tests/unit/components/ScaleLegend.spec.js +0 -139
- package/tests/unit/components/SecretInput.spec.js +0 -81
- package/tests/unit/components/SelectableDropdown.spec.js +0 -160
- package/tests/unit/components/SharingOptions.spec.js +0 -125
- package/tests/unit/components/SharingOptionsLink.spec.js +0 -184
- package/tests/unit/components/SignUpForm.spec.js +0 -145
- package/tests/unit/components/SlideUpDown.spec.js +0 -59
- package/tests/unit/components/TinyPagination.spec.js +0 -46
- package/tests/unit/config.spec.js +0 -136
- package/tests/unit/datavisualisations/BarChart.spec.js +0 -63
- package/tests/unit/datavisualisations/ColumnChart.spec.js +0 -344
- package/tests/unit/datavisualisations/LineChart.spec.js +0 -155
- package/tests/unit/datavisualisations/StackedBarChart.spec.js +0 -294
- package/tests/unit/datavisualisations/StackedColumnChart.spec.js +0 -443
- package/tests/unit/i18n.spec.ts +0 -19
- package/tests/unit/main.spec.js +0 -82
- package/tests/unit/maps/ChoroplethMap.spec.js +0 -214
- package/tests/unit/maps/ChoroplethMapAnnotation.spec.ts +0 -186
- package/tests/unit/maps/SymbolMap.spec.js +0 -92
- package/tests/unit/require.spec.js +0 -22
- package/tests/unit/setup.js +0 -13
- package/tests/unit/utils/assets.spec.js +0 -61
- package/tests/unit/utils/clipboard.spec.js +0 -18
- package/tests/unit/utils/iframe-resizer.spec.js +0 -71
- package/tsconfig.json +0 -35
- package/vite.config.ts +0 -79
- package/vitest.config.ts +0 -19
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
|
|
2
1
|
<script lang="ts">
|
|
3
2
|
import * as d3 from 'd3'
|
|
4
3
|
import isFunction from 'lodash/isFunction'
|
|
5
4
|
import identity from 'lodash/identity'
|
|
6
|
-
import {chartProps, getChartProps, useChart} from
|
|
7
|
-
import {
|
|
5
|
+
import { chartProps, getChartProps, useChart } from '@/composables/chart.js'
|
|
6
|
+
import {
|
|
7
|
+
computed,
|
|
8
|
+
ref,
|
|
9
|
+
defineComponent,
|
|
10
|
+
watchEffect,
|
|
11
|
+
ComponentPublicInstance,
|
|
12
|
+
toRaw
|
|
13
|
+
} from 'vue'
|
|
8
14
|
|
|
9
15
|
// Call the first argument if it's a function, or return it
|
|
10
|
-
const castCall = (fnOrValue = identity, ...rest) =>
|
|
16
|
+
const castCall = (fnOrValue = identity, ...rest) =>
|
|
17
|
+
isFunction(fnOrValue) ? fnOrValue(...rest) : fnOrValue
|
|
11
18
|
|
|
12
19
|
export default defineComponent({
|
|
13
20
|
name: 'LineChart',
|
|
@@ -55,7 +62,7 @@ export default defineComponent({
|
|
|
55
62
|
*/
|
|
56
63
|
yAxisTickFormat: {
|
|
57
64
|
type: [Function, String],
|
|
58
|
-
default: ()=>identity
|
|
65
|
+
default: () => identity
|
|
59
66
|
},
|
|
60
67
|
/**
|
|
61
68
|
* Argument for y-axis ticks
|
|
@@ -74,22 +81,22 @@ export default defineComponent({
|
|
|
74
81
|
},
|
|
75
82
|
...chartProps()
|
|
76
83
|
},
|
|
77
|
-
setup(props,{emit}){
|
|
78
|
-
const width =ref(0)
|
|
79
|
-
const height= ref(0)
|
|
80
|
-
const el= ref<ComponentPublicInstance<HTMLElement> | null>(null)
|
|
81
|
-
const line= ref<d3.Line<[number,number]
|
|
84
|
+
setup(props, { emit }) {
|
|
85
|
+
const width = ref(0)
|
|
86
|
+
const height = ref(0)
|
|
87
|
+
const el = ref<ComponentPublicInstance<HTMLElement> | null>(null)
|
|
88
|
+
const line = ref<d3.Line<[number, number]> | null>(null)
|
|
82
89
|
const isLoaded = ref(false)
|
|
83
90
|
|
|
84
|
-
const {
|
|
91
|
+
const {
|
|
92
|
+
loadedData,
|
|
85
93
|
elementsMaxBBox,
|
|
86
94
|
d3Formatter,
|
|
87
95
|
xAxisYearFormat,
|
|
88
96
|
baseHeightRatio
|
|
89
|
-
} = useChart(el,getChartProps(props),{emit},isLoaded,setSizes)
|
|
90
|
-
|
|
97
|
+
} = useChart(el, getChartProps(props), { emit }, isLoaded, setSizes)
|
|
91
98
|
|
|
92
|
-
const labelWidth = computed(()=> {
|
|
99
|
+
const labelWidth = computed(() => {
|
|
93
100
|
if (props.fixedLabelWidth) {
|
|
94
101
|
return props.fixedLabelWidth
|
|
95
102
|
}
|
|
@@ -97,63 +104,74 @@ export default defineComponent({
|
|
|
97
104
|
const defaultWidth = 100
|
|
98
105
|
return elementsMaxBBox({ selector, defaultWidth }).width
|
|
99
106
|
})
|
|
100
|
-
const labelHeight = computed(()=> {
|
|
107
|
+
const labelHeight = computed(() => {
|
|
101
108
|
const selector = '.line-chart__axis--y .tick'
|
|
102
109
|
const defaultHeight = 10
|
|
103
110
|
return elementsMaxBBox({ selector, defaultHeight }).height
|
|
104
111
|
})
|
|
105
|
-
const bucketHeight = computed(()=> {
|
|
112
|
+
const bucketHeight = computed(() => {
|
|
106
113
|
const selector = '.line-chart__axis--x .tick'
|
|
107
114
|
const defaultHeight = 10
|
|
108
115
|
return elementsMaxBBox({ selector, defaultHeight }).height
|
|
109
116
|
})
|
|
110
|
-
const bucketWidth = computed(()=> {
|
|
117
|
+
const bucketWidth = computed(() => {
|
|
111
118
|
const selector = '.line-chart__axis--x .tick text'
|
|
112
119
|
const defaultWidth = 0
|
|
113
120
|
return elementsMaxBBox({ selector, defaultWidth }).width
|
|
114
121
|
})
|
|
115
|
-
const scale = computed(()=> {
|
|
122
|
+
const scale = computed(() => {
|
|
116
123
|
return {
|
|
117
124
|
x: d3.scaleTime().range([0, padded.value.width]),
|
|
118
125
|
y: d3.scaleLinear().range([padded.value.height, 0])
|
|
119
126
|
}
|
|
120
127
|
})
|
|
121
|
-
const margin = computed(()=> {
|
|
128
|
+
const margin = computed(() => {
|
|
122
129
|
const left = labelWidth.value + 10
|
|
123
130
|
const right = bucketWidth.value / 2
|
|
124
131
|
const top = labelHeight.value
|
|
125
132
|
const bottom = bucketHeight.value + 10
|
|
126
133
|
return { left, right, top, bottom }
|
|
127
134
|
})
|
|
128
|
-
const padded = computed(()=> {
|
|
135
|
+
const padded = computed(() => {
|
|
129
136
|
const widthP = width.value - margin.value.left - margin.value.right
|
|
130
137
|
const heightP = height.value - margin.value.top - margin.value.bottom
|
|
131
|
-
return { width:widthP, height:heightP }
|
|
138
|
+
return { width: widthP, height: heightP }
|
|
132
139
|
})
|
|
133
|
-
const formattedData = computed(()=> {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
return loadedData.value.map(d => {
|
|
140
|
+
const formattedData = computed(() => {
|
|
141
|
+
if (!loadedData.value) {
|
|
142
|
+
return []
|
|
143
|
+
}
|
|
144
|
+
return loadedData.value.map((d) => {
|
|
138
145
|
// toRaw prevent modifying the Proxy object created with the props.data
|
|
139
146
|
let rawD = toRaw(d)
|
|
140
147
|
rawD[props.timeseriesKey] = parseTime(d[props.timeseriesKey])
|
|
141
|
-
rawD[props.seriesName]= +d[props.seriesName]
|
|
148
|
+
rawD[props.seriesName] = +d[props.seriesName]
|
|
142
149
|
return rawD
|
|
143
|
-
})
|
|
150
|
+
})
|
|
144
151
|
})
|
|
145
|
-
const createLine = d3
|
|
152
|
+
const createLine = d3
|
|
153
|
+
.line()
|
|
154
|
+
.x((d) => d.x)
|
|
155
|
+
.y((d) => d.y)
|
|
146
156
|
|
|
147
157
|
const parseTime = d3.timeParse('%Y')
|
|
148
158
|
function setSizes() {
|
|
149
|
-
if(el.value){
|
|
159
|
+
if (el.value) {
|
|
150
160
|
width.value = el.value.offsetWidth
|
|
151
|
-
height.value =
|
|
161
|
+
height.value =
|
|
162
|
+
props.fixedHeight !== null
|
|
163
|
+
? props.fixedHeight
|
|
164
|
+
: el.value.offsetWidth * baseHeightRatio.value
|
|
152
165
|
}
|
|
153
166
|
}
|
|
154
167
|
function update() {
|
|
155
|
-
scale.value.x.domain(
|
|
156
|
-
|
|
168
|
+
scale.value.x.domain(
|
|
169
|
+
d3.extent(formattedData.value, (d) => d[props.timeseriesKey])
|
|
170
|
+
)
|
|
171
|
+
scale.value.y.domain([
|
|
172
|
+
0,
|
|
173
|
+
d3.max(formattedData.value, (d) => d[props.seriesName])
|
|
174
|
+
])
|
|
157
175
|
|
|
158
176
|
const points = formattedData.value.map((d) => {
|
|
159
177
|
return {
|
|
@@ -164,24 +182,23 @@ export default defineComponent({
|
|
|
164
182
|
|
|
165
183
|
line.value = createLine(points)
|
|
166
184
|
d3.select(el.value)
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
185
|
+
.select('.line-chart__axis--x')
|
|
186
|
+
.call(
|
|
187
|
+
d3
|
|
188
|
+
.axisBottom(scale.value.x)
|
|
189
|
+
.ticks(props.xAxisTicks)
|
|
190
|
+
.tickFormat((d) => castCall(xAxisYearFormat, d.getFullYear()))
|
|
191
|
+
)
|
|
173
192
|
d3.select(el.value)
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
193
|
+
.select('.line-chart__axis--y')
|
|
194
|
+
.call(
|
|
195
|
+
d3
|
|
196
|
+
.axisLeft(scale.value.y)
|
|
197
|
+
.tickFormat((d) => d3Formatter(d, props.yAxisTickFormat))
|
|
198
|
+
.ticks(props.yAxisTicks)
|
|
199
|
+
)
|
|
200
|
+
.selectAll('.tick line')
|
|
201
|
+
.attr('x2', padded.value.width)
|
|
185
202
|
}
|
|
186
203
|
// function initialize() {
|
|
187
204
|
// d3.axisBottom().scale(scale.value.x)
|
|
@@ -203,8 +220,8 @@ export default defineComponent({
|
|
|
203
220
|
// watch(labelHeight,()=> {
|
|
204
221
|
// update()
|
|
205
222
|
// })
|
|
206
|
-
watchEffect(()=> {
|
|
207
|
-
|
|
223
|
+
watchEffect(() => {
|
|
224
|
+
update()
|
|
208
225
|
})
|
|
209
226
|
return {
|
|
210
227
|
el,
|
|
@@ -218,19 +235,24 @@ export default defineComponent({
|
|
|
218
235
|
})
|
|
219
236
|
</script>
|
|
220
237
|
<template>
|
|
221
|
-
<div
|
|
238
|
+
<div
|
|
239
|
+
ref="el"
|
|
240
|
+
class="line-chart"
|
|
241
|
+
:style="{ '--line-color': lineColor }"
|
|
242
|
+
:class="{ 'line-chart--social-mode': socialMode }"
|
|
243
|
+
>
|
|
222
244
|
<svg :width="width" :height="height">
|
|
223
245
|
<g
|
|
224
|
-
|
|
225
|
-
|
|
246
|
+
class="line-chart__axis line-chart__axis--x"
|
|
247
|
+
:style="{
|
|
226
248
|
transform: `translate(${margin.left}px, ${margin.top + padded.height}px)`
|
|
227
249
|
}"
|
|
228
250
|
>
|
|
229
251
|
>
|
|
230
252
|
</g>
|
|
231
253
|
<g
|
|
232
|
-
|
|
233
|
-
|
|
254
|
+
class="line-chart__axis line-chart__axis--y"
|
|
255
|
+
:style="{ transform: `translate(${margin.left}px, ${margin.top}px)` }"
|
|
234
256
|
>
|
|
235
257
|
>
|
|
236
258
|
</g>
|
|
@@ -7,9 +7,17 @@ import kebabCase from 'lodash/kebabCase'
|
|
|
7
7
|
import keys from 'lodash/keys'
|
|
8
8
|
import without from 'lodash/without'
|
|
9
9
|
import sortBy from 'lodash/sortBy'
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
import {
|
|
11
|
+
ComponentPublicInstance,
|
|
12
|
+
computed,
|
|
13
|
+
defineComponent,
|
|
14
|
+
nextTick,
|
|
15
|
+
PropType,
|
|
16
|
+
ref,
|
|
17
|
+
watch
|
|
18
|
+
} from 'vue'
|
|
19
|
+
import { chartProps, getChartProps, useChart } from '@/composables/chart.js'
|
|
20
|
+
import { isArray } from 'lodash'
|
|
13
21
|
|
|
14
22
|
export default defineComponent({
|
|
15
23
|
name: 'StackedBarChart',
|
|
@@ -134,17 +142,13 @@ export default defineComponent({
|
|
|
134
142
|
},
|
|
135
143
|
...chartProps()
|
|
136
144
|
},
|
|
137
|
-
setup(props, {emit}) {
|
|
145
|
+
setup(props, { emit }) {
|
|
138
146
|
const highlightedKeys = ref(props.highlights)
|
|
139
147
|
const highlightTimeout = ref<NodeJS.Timeout | undefined>(undefined)
|
|
140
148
|
const isLoaded = ref(false)
|
|
141
149
|
const el = ref<ComponentPublicInstance<HTMLElement> | null>(null)
|
|
142
|
-
const {
|
|
143
|
-
|
|
144
|
-
baseHeightRatio,
|
|
145
|
-
d3Formatter,
|
|
146
|
-
dataHasHighlights
|
|
147
|
-
} = useChart(el, getChartProps(props), {emit}, isLoaded)
|
|
150
|
+
const { loadedData, baseHeightRatio, d3Formatter, dataHasHighlights } =
|
|
151
|
+
useChart(el, getChartProps(props), { emit }, isLoaded)
|
|
148
152
|
|
|
149
153
|
const hasConstraintHeight = computed(() => {
|
|
150
154
|
return props.fixedHeight !== null || props.socialMode
|
|
@@ -154,7 +158,9 @@ export default defineComponent({
|
|
|
154
158
|
if (!isLoaded.value) {
|
|
155
159
|
return []
|
|
156
160
|
}
|
|
157
|
-
return !props.sortBy
|
|
161
|
+
return !props.sortBy
|
|
162
|
+
? loadedData.value
|
|
163
|
+
: sortBy(loadedData.value, props.sortBy)
|
|
158
164
|
})
|
|
159
165
|
const discoveredKeys = computed((): any[] => {
|
|
160
166
|
if (props.keys.length) {
|
|
@@ -166,7 +172,10 @@ export default defineComponent({
|
|
|
166
172
|
return without(keys(loadedData.value[0]), props.labelField)
|
|
167
173
|
})
|
|
168
174
|
const colorScale = computed(() => {
|
|
169
|
-
return d3
|
|
175
|
+
return d3
|
|
176
|
+
.scaleOrdinal()
|
|
177
|
+
.domain(discoveredKeys.value)
|
|
178
|
+
.range(props.barColors)
|
|
170
179
|
})
|
|
171
180
|
const maxValue = computed(() => {
|
|
172
181
|
return d3.max(loadedData.value || [], (datum, i) => {
|
|
@@ -183,7 +192,9 @@ export default defineComponent({
|
|
|
183
192
|
if (props.fixedHeight !== null) {
|
|
184
193
|
return `${props.fixedHeight}px`
|
|
185
194
|
}
|
|
186
|
-
return props.socialMode && el.value
|
|
195
|
+
return props.socialMode && el.value
|
|
196
|
+
? `${el.value.offsetWidth * baseHeightRatio.value}px`
|
|
197
|
+
: 'auto'
|
|
187
198
|
})
|
|
188
199
|
|
|
189
200
|
function normalizeKey(key: string) {
|
|
@@ -209,7 +220,10 @@ export default defineComponent({
|
|
|
209
220
|
clearTimeout(highlightTimeout.value)
|
|
210
221
|
const delay = props.restoreHighlightDelay
|
|
211
222
|
// Delay the restoration so it can be cancelled by a new highlight
|
|
212
|
-
highlightTimeout.value = setTimeout(
|
|
223
|
+
highlightTimeout.value = setTimeout(
|
|
224
|
+
() => (highlightedKeys.value = props.highlights),
|
|
225
|
+
delay
|
|
226
|
+
)
|
|
213
227
|
}
|
|
214
228
|
|
|
215
229
|
function delayHighlight(key: string) {
|
|
@@ -226,18 +240,22 @@ export default defineComponent({
|
|
|
226
240
|
|
|
227
241
|
function isRowHighlighted(i: number | string) {
|
|
228
242
|
const row = get(sortedData.value, [i, props.labelField], null)
|
|
229
|
-
return (
|
|
243
|
+
return (
|
|
244
|
+
isArray(props.rowHighlights) &&
|
|
245
|
+
props.rowHighlights?.includes(row) &&
|
|
246
|
+
!highlightedKeys.value.length
|
|
247
|
+
)
|
|
230
248
|
}
|
|
231
249
|
|
|
232
250
|
function barStyle(i: number | string, key: string) {
|
|
233
251
|
const value = sortedData.value[i][key]
|
|
234
252
|
const totalWidth = props.relative ? totalRowValue(i) : maxValue.value
|
|
235
253
|
if (!totalWidth) {
|
|
236
|
-
throw new Error(
|
|
254
|
+
throw new Error('Total width is not correct' + totalWidth)
|
|
237
255
|
}
|
|
238
256
|
const width = `${100 * (value / totalWidth)}%`
|
|
239
257
|
const backgroundColor = colorScale.value(key)
|
|
240
|
-
return {width, backgroundColor}
|
|
258
|
+
return { width, backgroundColor }
|
|
241
259
|
}
|
|
242
260
|
|
|
243
261
|
// function barHeightBounds(height:number) {
|
|
@@ -250,15 +268,15 @@ export default defineComponent({
|
|
|
250
268
|
await nextTick()
|
|
251
269
|
// Collect sizes first
|
|
252
270
|
const stack = discoveredKeys.value.map((key: string) => {
|
|
253
|
-
const {bar, row, value} = queryBarAndValue(i as number, key)
|
|
271
|
+
const { bar, row, value } = queryBarAndValue(i as number, key)
|
|
254
272
|
if (!bar || !row || !value) {
|
|
255
|
-
throw new Error(
|
|
273
|
+
throw new Error('Values not retrieved')
|
|
256
274
|
}
|
|
257
275
|
const barEdge = bar.getBoundingClientRect().left + bar.offsetWidth
|
|
258
276
|
const barWidth = bar.offsetWidth
|
|
259
277
|
const rowEdge = row.getBoundingClientRect().left + row.offsetWidth
|
|
260
278
|
const valueWidth = value.offsetWidth
|
|
261
|
-
return
|
|
279
|
+
return { key, barEdge, barWidth, rowEdge, valueWidth }
|
|
262
280
|
})
|
|
263
281
|
// Infer value's display
|
|
264
282
|
return stack.map((desc, index) => {
|
|
@@ -266,9 +284,12 @@ export default defineComponent({
|
|
|
266
284
|
if (index > 0) {
|
|
267
285
|
const prevDesc = stack[index - 1]
|
|
268
286
|
const bothValuesWidth = desc.valueWidth + prevDesc.valueWidth
|
|
269
|
-
desc.overflow =
|
|
287
|
+
desc.overflow =
|
|
288
|
+
desc.overflow ||
|
|
289
|
+
(prevDesc.overflow && desc.barWidth < bothValuesWidth)
|
|
270
290
|
}
|
|
271
|
-
desc.pushed =
|
|
291
|
+
desc.pushed =
|
|
292
|
+
desc.barEdge + desc.valueWidth > desc.rowEdge && desc.overflow
|
|
272
293
|
return desc
|
|
273
294
|
})
|
|
274
295
|
}
|
|
@@ -285,17 +306,17 @@ export default defineComponent({
|
|
|
285
306
|
const bar = row?.querySelector(barSelector) as HTMLElement
|
|
286
307
|
const valueSelector = `.${barClass}__value`
|
|
287
308
|
const value = bar?.querySelector(valueSelector) as HTMLElement
|
|
288
|
-
return {bar, row, value}
|
|
309
|
+
return { bar, row, value }
|
|
289
310
|
}
|
|
290
311
|
|
|
291
|
-
|
|
292
|
-
const stack =
|
|
293
|
-
return get(find(stack, {key}), 'overflow')
|
|
312
|
+
async function hasValueOverflow(i: number | string, key: string) {
|
|
313
|
+
const stack = await stackBarAndValue(i)
|
|
314
|
+
return get(find(stack, { key }), 'overflow')
|
|
294
315
|
}
|
|
295
316
|
|
|
296
317
|
async function hasValuePushed(i: number | string, key: string) {
|
|
297
318
|
const stack = await stackBarAndValue(i)
|
|
298
|
-
return get(find(stack, {key}), 'pushed')
|
|
319
|
+
return get(find(stack, { key }), 'pushed')
|
|
299
320
|
}
|
|
300
321
|
|
|
301
322
|
async function hasValueHidden(i: number | string, key: string) {
|
|
@@ -339,9 +360,12 @@ export default defineComponent({
|
|
|
339
360
|
return d3Formatter(d, props.xAxisTickFormat)
|
|
340
361
|
}
|
|
341
362
|
|
|
342
|
-
watch(
|
|
343
|
-
|
|
344
|
-
|
|
363
|
+
watch(
|
|
364
|
+
() => props.highlights,
|
|
365
|
+
(newHighlights) => {
|
|
366
|
+
highlightedKeys.value = newHighlights
|
|
367
|
+
}
|
|
368
|
+
)
|
|
345
369
|
|
|
346
370
|
return {
|
|
347
371
|
colorScale,
|
|
@@ -367,7 +391,6 @@ export default defineComponent({
|
|
|
367
391
|
normalizeKey,
|
|
368
392
|
restoreHighlights
|
|
369
393
|
}
|
|
370
|
-
|
|
371
394
|
}
|
|
372
395
|
|
|
373
396
|
// watch: {
|
|
@@ -387,69 +410,87 @@ export default defineComponent({
|
|
|
387
410
|
// }
|
|
388
411
|
// }
|
|
389
412
|
// },
|
|
390
|
-
|
|
391
413
|
})
|
|
392
414
|
</script>
|
|
393
415
|
<template>
|
|
394
416
|
<div
|
|
395
|
-
|
|
396
|
-
|
|
417
|
+
ref="el"
|
|
418
|
+
:class="{
|
|
397
419
|
'stacked-bar-chart--social-mode': socialMode,
|
|
398
420
|
'stacked-bar-chart--label-above': labelAbove,
|
|
399
|
-
'stacked-bar-chart--has-highlights':
|
|
421
|
+
'stacked-bar-chart--has-highlights':
|
|
422
|
+
hasHighlights || hasRowHighlights || dataHasHighlights,
|
|
400
423
|
'stacked-bar-chart--has-constraint-height': hasConstraintHeight,
|
|
401
424
|
'stacked-bar-chart--has-label-above': labelAbove
|
|
402
425
|
}"
|
|
403
|
-
|
|
404
|
-
|
|
426
|
+
:style="{ height }"
|
|
427
|
+
class="stacked-bar-chart d-flex flex-column"
|
|
405
428
|
>
|
|
406
429
|
<div class="d-flex align-items-center">
|
|
407
430
|
<slot name="header-left">
|
|
408
|
-
<ul
|
|
431
|
+
<ul
|
|
432
|
+
v-if="!hideLegend"
|
|
433
|
+
class="stacked-bar-chart__legend list-inline mx-0 mt-0 mb-2"
|
|
434
|
+
>
|
|
409
435
|
<li
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
436
|
+
v-for="key in discoveredKeys"
|
|
437
|
+
:key="key"
|
|
438
|
+
:class="{
|
|
413
439
|
'stacked-bar-chart__legend__item--highlighted': isHighlighted(key)
|
|
414
440
|
}"
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
441
|
+
class="stacked-bar-chart__legend__item list-inline-item d-inline-flex"
|
|
442
|
+
@mouseleave="restoreHighlights()"
|
|
443
|
+
@mouseover="delayHighlight(key)"
|
|
418
444
|
>
|
|
419
|
-
<span
|
|
445
|
+
<span
|
|
446
|
+
:style="{ 'background-color': colorScale(key) }"
|
|
447
|
+
class="stacked-bar-chart__legend__item__box"
|
|
448
|
+
/>
|
|
420
449
|
{{ groupName(key) }}
|
|
421
450
|
</li>
|
|
422
451
|
</ul>
|
|
423
452
|
</slot>
|
|
424
|
-
<slot name="header-right"/>
|
|
453
|
+
<slot name="header-right" />
|
|
425
454
|
</div>
|
|
426
455
|
<div class="stacked-bar-chart__groups">
|
|
427
456
|
<div
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
457
|
+
v-for="(datum, i) in sortedData"
|
|
458
|
+
:key="i"
|
|
459
|
+
:class="{ 'flex-column': labelAbove }"
|
|
460
|
+
class="stacked-bar-chart__groups__item border-bottom flex-fill d-flex align-items-center"
|
|
432
461
|
>
|
|
433
|
-
<div
|
|
462
|
+
<div
|
|
463
|
+
:class="{ 'w-100': labelAbove }"
|
|
464
|
+
class="stacked-bar-chart__groups__item__label me-1 small"
|
|
465
|
+
>
|
|
434
466
|
{{ datum[labelField] }}
|
|
435
467
|
</div>
|
|
436
|
-
<div
|
|
468
|
+
<div
|
|
469
|
+
class="stacked-bar-chart__groups__item__bars my-1 d-flex flex-grow-1 align-items-center"
|
|
470
|
+
>
|
|
437
471
|
<div
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
472
|
+
v-for="(key, j) in discoveredKeys"
|
|
473
|
+
:key="j"
|
|
474
|
+
:class="{
|
|
441
475
|
[`stacked-bar-chart__groups__item__bars__item--${normalizeKey(key)}`]: true,
|
|
442
476
|
[`stacked-bar-chart__groups__item__bars__item--${j}n`]: true,
|
|
443
|
-
'stacked-bar-chart__groups__item__bars__item--highlighted':
|
|
444
|
-
|
|
445
|
-
'stacked-bar-chart__groups__item__bars__item--
|
|
446
|
-
|
|
447
|
-
|
|
477
|
+
'stacked-bar-chart__groups__item__bars__item--highlighted':
|
|
478
|
+
isHighlighted(key) || isRowHighlighted(i),
|
|
479
|
+
'stacked-bar-chart__groups__item__bars__item--hidden': isHidden(
|
|
480
|
+
i,
|
|
481
|
+
key
|
|
482
|
+
),
|
|
483
|
+
'stacked-bar-chart__groups__item__bars__item--value-overflow':
|
|
484
|
+
hasValueOverflow(i, key),
|
|
485
|
+
'stacked-bar-chart__groups__item__bars__item--value-pushed':
|
|
486
|
+
hasValuePushed(i, key),
|
|
487
|
+
'stacked-bar-chart__groups__item__bars__item--value-hidden':
|
|
488
|
+
hasValueHidden(i, key)
|
|
448
489
|
}"
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
490
|
+
:style="barStyle(i, key)"
|
|
491
|
+
class="stacked-bar-chart__groups__item__bars__item"
|
|
492
|
+
@mouseleave="restoreHighlights()"
|
|
493
|
+
@mouseover="delayHighlight(key)"
|
|
453
494
|
>
|
|
454
495
|
<div class="stacked-bar-chart__groups__item__bars__item__value p-1">
|
|
455
496
|
{{ formatXDatum(datum[key]) }}
|
|
@@ -467,7 +508,9 @@ export default defineComponent({
|
|
|
467
508
|
.stacked-bar-chart {
|
|
468
509
|
$muted-group-opacity: 0.2;
|
|
469
510
|
$muted-group-filter: grayscale(30%) brightness(10%);
|
|
470
|
-
$muted-group-transition:
|
|
511
|
+
$muted-group-transition:
|
|
512
|
+
opacity 0.3s,
|
|
513
|
+
filter 0.3s;
|
|
471
514
|
$colors: $primary, $info, $warning;
|
|
472
515
|
$quantile: 3;
|
|
473
516
|
|
|
@@ -541,7 +584,8 @@ export default defineComponent({
|
|
|
541
584
|
min-height: calc(100% - 1.5rem);
|
|
542
585
|
}
|
|
543
586
|
|
|
544
|
-
.stacked-bar-chart--has-constraint-height.stacked-bar-chart--label-above
|
|
587
|
+
.stacked-bar-chart--has-constraint-height.stacked-bar-chart--label-above
|
|
588
|
+
& {
|
|
545
589
|
height: auto;
|
|
546
590
|
min-height: auto;
|
|
547
591
|
}
|
|
@@ -581,8 +625,12 @@ export default defineComponent({
|
|
|
581
625
|
visibility: hidden;
|
|
582
626
|
}
|
|
583
627
|
|
|
584
|
-
.stacked-bar-chart:not(.stacked-bar-chart--has-highlights)
|
|
585
|
-
|
|
628
|
+
.stacked-bar-chart:not(.stacked-bar-chart--has-highlights)
|
|
629
|
+
&--value-hidden
|
|
630
|
+
&__value,
|
|
631
|
+
.stacked-bar-chart:not(.stacked-bar-chart--has-highlights)
|
|
632
|
+
&--value-pushed
|
|
633
|
+
&__value {
|
|
586
634
|
visibility: hidden;
|
|
587
635
|
}
|
|
588
636
|
|