@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,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {values} from 'lodash'
|
|
3
|
-
import {geoDistance, GeoProjection} from 'd3-geo'
|
|
4
|
-
import {computed, defineComponent, inject, toRaw} from
|
|
5
|
-
import {ParentKey} from
|
|
6
|
-
import {ParentMap} from
|
|
2
|
+
import { values } from 'lodash'
|
|
3
|
+
import { geoDistance, GeoProjection } from 'd3-geo'
|
|
4
|
+
import { computed, defineComponent, inject, toRaw } from 'vue'
|
|
5
|
+
import { ParentKey } from '@/keys'
|
|
6
|
+
import { ParentMap } from '@/types'
|
|
7
7
|
|
|
8
8
|
export const PLACEMENTS = {
|
|
9
9
|
TOP: 'top',
|
|
@@ -87,21 +87,21 @@ export default defineComponent({
|
|
|
87
87
|
placement: {
|
|
88
88
|
type: String,
|
|
89
89
|
default: null,
|
|
90
|
-
validator: (p: null | string) =>
|
|
90
|
+
validator: (p: null | string) =>
|
|
91
|
+
p === null || values(PLACEMENTS).includes(p)
|
|
91
92
|
}
|
|
92
93
|
},
|
|
93
94
|
setup(props) {
|
|
94
|
-
|
|
95
95
|
const parent = inject<ParentMap>(ParentKey)
|
|
96
96
|
|
|
97
97
|
if (!parent) {
|
|
98
|
-
throw new Error(
|
|
98
|
+
throw new Error('parent is undefined')
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
const mapRect = parent.mapRect
|
|
102
102
|
const mapTransform1 = parent.mapTransform
|
|
103
103
|
const rotatingMapProjection = parent.rotatingMapProjection
|
|
104
|
-
const mapTransform= computed(()=>{
|
|
104
|
+
const mapTransform = computed(() => {
|
|
105
105
|
return toRaw(parent.mapTransform)
|
|
106
106
|
})
|
|
107
107
|
|
|
@@ -112,7 +112,7 @@ export default defineComponent({
|
|
|
112
112
|
if (isBottom.value) {
|
|
113
113
|
return 0
|
|
114
114
|
}
|
|
115
|
-
return 0 -
|
|
115
|
+
return 0 - props.height / 2
|
|
116
116
|
})
|
|
117
117
|
const isTop = computed(() => {
|
|
118
118
|
return [
|
|
@@ -143,7 +143,7 @@ export default defineComponent({
|
|
|
143
143
|
|
|
144
144
|
const position = computed(() => {
|
|
145
145
|
const [x, y] = projection.value(center.value)
|
|
146
|
-
return {x, y}
|
|
146
|
+
return { x, y }
|
|
147
147
|
})
|
|
148
148
|
|
|
149
149
|
const mapK = computed(() => {
|
|
@@ -157,7 +157,7 @@ export default defineComponent({
|
|
|
157
157
|
if (isLeft.value) {
|
|
158
158
|
return 0 - props.width
|
|
159
159
|
}
|
|
160
|
-
return 0 -
|
|
160
|
+
return 0 - props.width / 2
|
|
161
161
|
})
|
|
162
162
|
|
|
163
163
|
const transform = computed(() => {
|
|
@@ -241,7 +241,10 @@ export default defineComponent({
|
|
|
241
241
|
if (!projection.value?.invert) {
|
|
242
242
|
return 0
|
|
243
243
|
}
|
|
244
|
-
const mapCenter = projection.value.invert([
|
|
244
|
+
const mapCenter = projection.value.invert([
|
|
245
|
+
mapRect.value.width / 2,
|
|
246
|
+
mapRect.value.height / 2
|
|
247
|
+
])
|
|
245
248
|
return geoDistance(center.value, mapCenter)
|
|
246
249
|
} catch (_) {
|
|
247
250
|
return 0
|
|
@@ -251,7 +254,6 @@ export default defineComponent({
|
|
|
251
254
|
return geoDistanceFromCenter.value <= props.geoDistanceThreshold
|
|
252
255
|
})
|
|
253
256
|
|
|
254
|
-
|
|
255
257
|
return {
|
|
256
258
|
classList,
|
|
257
259
|
x,
|
|
@@ -273,16 +275,25 @@ export default defineComponent({
|
|
|
273
275
|
mapTransform
|
|
274
276
|
}
|
|
275
277
|
}
|
|
276
|
-
|
|
277
278
|
})
|
|
278
279
|
</script>
|
|
279
280
|
|
|
280
281
|
<template>
|
|
281
282
|
<g :class="classList" class="choropleth-map-annotation">
|
|
282
|
-
<foreignObject
|
|
283
|
-
|
|
283
|
+
<foreignObject
|
|
284
|
+
:height="height"
|
|
285
|
+
:transform="transform"
|
|
286
|
+
:width="width"
|
|
287
|
+
:x="x"
|
|
288
|
+
:y="y"
|
|
289
|
+
>
|
|
290
|
+
<div
|
|
291
|
+
v-show="isVisible"
|
|
292
|
+
:style="wrapperStyle"
|
|
293
|
+
class="choropleth-map-annotation__wrapper"
|
|
294
|
+
>
|
|
284
295
|
<div class="choropleth-map-annotation__wrapper__content">
|
|
285
|
-
<slot/>
|
|
296
|
+
<slot />
|
|
286
297
|
</div>
|
|
287
298
|
</div>
|
|
288
299
|
</foreignObject>
|
package/lib/maps/SymbolMap.vue
CHANGED
|
@@ -1,15 +1,39 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import * as d3 from 'd3'
|
|
3
|
-
import {GeoPermissibleObjects} from 'd3'
|
|
4
|
-
import {geoRobinson} from 'd3-geo-projection'
|
|
5
|
-
import {feature} from 'topojson'
|
|
6
|
-
import {
|
|
3
|
+
import { GeoPermissibleObjects } from 'd3'
|
|
4
|
+
import { geoRobinson } from 'd3-geo-projection'
|
|
5
|
+
import { feature } from 'topojson'
|
|
6
|
+
import {
|
|
7
|
+
debounce,
|
|
8
|
+
find,
|
|
9
|
+
get,
|
|
10
|
+
groupBy,
|
|
11
|
+
isFunction,
|
|
12
|
+
kebabCase,
|
|
13
|
+
keys,
|
|
14
|
+
pickBy,
|
|
15
|
+
set,
|
|
16
|
+
uniq,
|
|
17
|
+
uniqueId
|
|
18
|
+
} from 'lodash'
|
|
7
19
|
|
|
8
20
|
import config from '../config'
|
|
9
21
|
import OrdinalLegend from '../components/OrdinalLegend.vue'
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
22
|
+
import {
|
|
23
|
+
chartEmits,
|
|
24
|
+
chartProps,
|
|
25
|
+
getChartProps,
|
|
26
|
+
useChart
|
|
27
|
+
} from '@/composables/chart.js'
|
|
28
|
+
import {
|
|
29
|
+
ComponentPublicInstance,
|
|
30
|
+
computed,
|
|
31
|
+
defineComponent,
|
|
32
|
+
PropType,
|
|
33
|
+
ref,
|
|
34
|
+
watch
|
|
35
|
+
} from 'vue'
|
|
36
|
+
import { GeometryCollection } from 'topojson-specification'
|
|
13
37
|
|
|
14
38
|
export default defineComponent({
|
|
15
39
|
components: {
|
|
@@ -55,7 +79,7 @@ export default defineComponent({
|
|
|
55
79
|
markerPath: {
|
|
56
80
|
type: [String, Function],
|
|
57
81
|
default:
|
|
58
|
-
|
|
82
|
+
'M512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256z'
|
|
59
83
|
},
|
|
60
84
|
markerColor: {
|
|
61
85
|
type: String,
|
|
@@ -109,8 +133,8 @@ export default defineComponent({
|
|
|
109
133
|
},
|
|
110
134
|
...chartProps()
|
|
111
135
|
},
|
|
112
|
-
emits: [
|
|
113
|
-
setup(props, {emit}) {
|
|
136
|
+
emits: ['click', 'reset', 'zoomed', ...chartEmits],
|
|
137
|
+
setup(props, { emit }) {
|
|
114
138
|
const el = ref<ComponentPublicInstance<HTMLElement> | null>(null)
|
|
115
139
|
const topojson = ref<any>(null)
|
|
116
140
|
const topojsonPromise = ref<Promise<void> | null>(null)
|
|
@@ -124,7 +148,14 @@ export default defineComponent({
|
|
|
124
148
|
draw()
|
|
125
149
|
}, 10)
|
|
126
150
|
|
|
127
|
-
const {loadedData} = useChart(
|
|
151
|
+
const { loadedData } = useChart(
|
|
152
|
+
el,
|
|
153
|
+
getChartProps(props),
|
|
154
|
+
{ emit },
|
|
155
|
+
isLoaded,
|
|
156
|
+
debouncedDraw,
|
|
157
|
+
afterLoaded
|
|
158
|
+
)
|
|
128
159
|
|
|
129
160
|
function afterLoaded() {
|
|
130
161
|
return new Promise<void>(async (resolve) => {
|
|
@@ -151,7 +182,11 @@ export default defineComponent({
|
|
|
151
182
|
return props.fitToMarkers ? markersGeojson.value : featuresGeojson.value
|
|
152
183
|
})
|
|
153
184
|
const featuresGeojson = computed(() => {
|
|
154
|
-
const object = get(
|
|
185
|
+
const object = get(
|
|
186
|
+
topojson.value,
|
|
187
|
+
['objects', props.topojsonObjects],
|
|
188
|
+
null
|
|
189
|
+
)
|
|
155
190
|
return feature(topojson.value, object as GeometryCollection)
|
|
156
191
|
})
|
|
157
192
|
const markersGeojson = computed(() => {
|
|
@@ -164,7 +199,7 @@ export default defineComponent({
|
|
|
164
199
|
}
|
|
165
200
|
})
|
|
166
201
|
const coordinates = computed(() => {
|
|
167
|
-
return (loadedData.value || []).map(({longitude, latitude}) => {
|
|
202
|
+
return (loadedData.value || []).map(({ longitude, latitude }) => {
|
|
168
203
|
return [longitude, latitude]
|
|
169
204
|
})
|
|
170
205
|
})
|
|
@@ -180,25 +215,25 @@ export default defineComponent({
|
|
|
180
215
|
}
|
|
181
216
|
})
|
|
182
217
|
const mapProjection = computed(() => {
|
|
183
|
-
const {height, width} = mapRect.value
|
|
218
|
+
const { height, width } = mapRect.value
|
|
184
219
|
const padding = props.mapPadding
|
|
185
220
|
return geoRobinson().fitExtent(
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
221
|
+
[
|
|
222
|
+
[padding, padding],
|
|
223
|
+
[width - padding, height - padding]
|
|
224
|
+
],
|
|
225
|
+
geojson.value
|
|
191
226
|
)
|
|
192
227
|
})
|
|
193
228
|
const mapZoom = computed(() => {
|
|
194
229
|
return d3
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
230
|
+
.zoom()
|
|
231
|
+
.scaleExtent([props.zoomMin, props.zoomMax])
|
|
232
|
+
.translateExtent([
|
|
233
|
+
[0, 0],
|
|
234
|
+
[mapWidth.value, mapHeight.value]
|
|
235
|
+
])
|
|
236
|
+
.on('zoom', mapZoomed)
|
|
202
237
|
})
|
|
203
238
|
const mapHeight = computed(() => {
|
|
204
239
|
return mapRect.value.height
|
|
@@ -207,9 +242,11 @@ export default defineComponent({
|
|
|
207
242
|
return mapRect.value.width
|
|
208
243
|
})
|
|
209
244
|
const map = computed(() => {
|
|
210
|
-
const selection = d3
|
|
245
|
+
const selection = d3
|
|
246
|
+
.select(el.value)
|
|
247
|
+
.select<SVGElement>('.symbol-map__main')
|
|
211
248
|
if (!selection) {
|
|
212
|
-
throw new Error(
|
|
249
|
+
throw new Error('Empty SVG selection')
|
|
213
250
|
}
|
|
214
251
|
return selection
|
|
215
252
|
})
|
|
@@ -237,29 +274,26 @@ export default defineComponent({
|
|
|
237
274
|
return get(d, props.categoryObjectsPath)
|
|
238
275
|
})
|
|
239
276
|
return Object.entries(categories).map((entry) => {
|
|
240
|
-
const [label, [{color: firstColor}]] = entry
|
|
277
|
+
const [label, [{ color: firstColor }]] = entry
|
|
241
278
|
const color = firstColor || categoryColor(label)
|
|
242
|
-
return {label, color}
|
|
279
|
+
return { label, color }
|
|
243
280
|
})
|
|
244
281
|
})
|
|
245
282
|
const hasTooltip = computed(() => {
|
|
246
283
|
return !props.hideTooltip && loadedData.value && markerCursor.value
|
|
247
284
|
})
|
|
248
285
|
const tooltipTarget = computed(() => {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
)
|
|
255
|
-
|
|
286
|
+
if (hasTooltip.value) {
|
|
287
|
+
return markerId(markerCursor.value)
|
|
288
|
+
}
|
|
289
|
+
return null
|
|
290
|
+
})
|
|
256
291
|
|
|
257
292
|
//methods
|
|
258
293
|
|
|
259
|
-
|
|
260
294
|
function prepare() {
|
|
261
295
|
if (!map.value) {
|
|
262
|
-
throw new Error(
|
|
296
|
+
throw new Error('Map is null')
|
|
263
297
|
}
|
|
264
298
|
// Set the map sizes
|
|
265
299
|
mapRect.value = map.value.node()?.getBoundingClientRect() as DOMRect
|
|
@@ -287,24 +321,25 @@ export default defineComponent({
|
|
|
287
321
|
function draw() {
|
|
288
322
|
prepare()
|
|
289
323
|
if (!map.value) {
|
|
290
|
-
throw new Error(
|
|
324
|
+
throw new Error('map is not defined')
|
|
291
325
|
}
|
|
292
326
|
update()
|
|
293
327
|
// Bind a group for marker paths
|
|
294
|
-
map.value
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
328
|
+
map.value
|
|
329
|
+
?.append('g')
|
|
330
|
+
.attr('class', 'symbol-map__main__markers')
|
|
331
|
+
.selectAll('.symbol-map__main__markers__item')
|
|
332
|
+
.data(loadedDataWithIds.value)
|
|
333
|
+
.enter()
|
|
334
|
+
.append('g')
|
|
335
|
+
.attr('id', markerId)
|
|
336
|
+
.attr('class', markerClass)
|
|
337
|
+
.attr('transform', markerTransform)
|
|
338
|
+
.append('path')
|
|
339
|
+
.on('mouseover', markerMouseOver)
|
|
340
|
+
.on('mouseleave', markerMouseLeave)
|
|
341
|
+
.attr('d', markerPathFunction)
|
|
342
|
+
.attr('fill', markerColorFunction)
|
|
308
343
|
prepareZoom()
|
|
309
344
|
}
|
|
310
345
|
|
|
@@ -325,7 +360,7 @@ export default defineComponent({
|
|
|
325
360
|
async function loadTopojson() {
|
|
326
361
|
if (!topojsonPromise.value) {
|
|
327
362
|
if (!props.topojsonUrl?.length) {
|
|
328
|
-
throw new Error(
|
|
363
|
+
throw new Error('Empty topojsonUrl')
|
|
329
364
|
}
|
|
330
365
|
topojsonPromise.value = d3.json(props.topojsonUrl)
|
|
331
366
|
topojson.value = await topojsonPromise.value
|
|
@@ -333,11 +368,12 @@ export default defineComponent({
|
|
|
333
368
|
return topojsonPromise.value
|
|
334
369
|
}
|
|
335
370
|
|
|
336
|
-
function mapZoomed({transform}) {
|
|
371
|
+
function mapZoomed({ transform }) {
|
|
337
372
|
markerCursor.value = null
|
|
338
|
-
map.value
|
|
339
|
-
|
|
340
|
-
|
|
373
|
+
map.value
|
|
374
|
+
?.style('--map-scale', transform.k)
|
|
375
|
+
.selectAll('.symbol-map__main__features, .symbol-map__main__markers')
|
|
376
|
+
.attr('transform', transform)
|
|
341
377
|
}
|
|
342
378
|
|
|
343
379
|
function markerBoundingClientRect(d) {
|
|
@@ -380,15 +416,24 @@ export default defineComponent({
|
|
|
380
416
|
}
|
|
381
417
|
|
|
382
418
|
function markerPathFunction(d) {
|
|
383
|
-
return isFunction(props.markerPath)
|
|
419
|
+
return isFunction(props.markerPath)
|
|
420
|
+
? props.markerPath(d)
|
|
421
|
+
: props.markerPath
|
|
384
422
|
}
|
|
385
423
|
|
|
386
|
-
function markerColorFunction({color, ...d}) {
|
|
387
|
-
return
|
|
424
|
+
function markerColorFunction({ color, ...d }) {
|
|
425
|
+
return (
|
|
426
|
+
color ||
|
|
427
|
+
(isFunction(props.markerColor)
|
|
428
|
+
? props.markerColor(d)
|
|
429
|
+
: props.markerColor)
|
|
430
|
+
)
|
|
388
431
|
}
|
|
389
432
|
|
|
390
433
|
function markerWidthFunction(d) {
|
|
391
|
-
return isFunction(props.markerWidth)
|
|
434
|
+
return isFunction(props.markerWidth)
|
|
435
|
+
? props.markerWidth(d)
|
|
436
|
+
: props.markerWidth
|
|
392
437
|
}
|
|
393
438
|
|
|
394
439
|
function markerLabel(d) {
|
|
@@ -396,8 +441,8 @@ export default defineComponent({
|
|
|
396
441
|
}
|
|
397
442
|
|
|
398
443
|
function markerTransform(d) {
|
|
399
|
-
const {latitude, longitude} = d
|
|
400
|
-
const {height, width} = markerBoundingClientRect(d)
|
|
444
|
+
const { latitude, longitude } = d
|
|
445
|
+
const { height, width } = markerBoundingClientRect(d)
|
|
401
446
|
const [x, y] = mapProjection.value([longitude, latitude])
|
|
402
447
|
const scale = markerWidthFunction(d) / Math.max(1, width)
|
|
403
448
|
const cx = x - (width / 2) * scale
|
|
@@ -405,7 +450,10 @@ export default defineComponent({
|
|
|
405
450
|
return `translate(${cx}, ${cy}) scale(${scale})`
|
|
406
451
|
}
|
|
407
452
|
|
|
408
|
-
async function featureClicked(
|
|
453
|
+
async function featureClicked(
|
|
454
|
+
event: MouseEvent,
|
|
455
|
+
d: d3.GeoPermissibleObjects
|
|
456
|
+
) {
|
|
409
457
|
/**
|
|
410
458
|
* A click on a feature
|
|
411
459
|
* @event click
|
|
@@ -429,10 +477,11 @@ export default defineComponent({
|
|
|
429
477
|
}
|
|
430
478
|
|
|
431
479
|
function resetZoom(_event: MouseEvent, _d: number) {
|
|
432
|
-
map.value
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
480
|
+
map.value
|
|
481
|
+
?.style('--map-scale', 1)
|
|
482
|
+
.transition()
|
|
483
|
+
.duration(props.transitionDuration)
|
|
484
|
+
.call(mapZoom.value.transform, d3.zoomIdentity)
|
|
436
485
|
featureZoom.value = null
|
|
437
486
|
|
|
438
487
|
/**
|
|
@@ -443,7 +492,9 @@ export default defineComponent({
|
|
|
443
492
|
}
|
|
444
493
|
|
|
445
494
|
function setMarkersClasses() {
|
|
446
|
-
map.value
|
|
495
|
+
map.value
|
|
496
|
+
?.selectAll('.symbol-map__main__markers__item')
|
|
497
|
+
.attr('class', markerClass)
|
|
447
498
|
}
|
|
448
499
|
|
|
449
500
|
function setFeatureZoom(d: GeoPermissibleObjects, pointer = [0, 0]) {
|
|
@@ -452,20 +503,24 @@ export default defineComponent({
|
|
|
452
503
|
}
|
|
453
504
|
featureZoom.value = get(d, props.topojsonObjectsPath)
|
|
454
505
|
|
|
455
|
-
const {height, width} = mapRect.value
|
|
506
|
+
const { height, width } = mapRect.value
|
|
456
507
|
const [[x0, y0], [x1, y1]] = featurePath.value.bounds(d)
|
|
457
|
-
const scale = Math.min(
|
|
508
|
+
const scale = Math.min(
|
|
509
|
+
8,
|
|
510
|
+
0.9 / Math.max((x1 - x0) / width, (y1 - y0) / height)
|
|
511
|
+
)
|
|
458
512
|
const x = -(x0 + x1) / 2
|
|
459
513
|
const y = -(y0 + y1) / 2
|
|
460
514
|
const zoomIdentity = d3.zoomIdentity
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
return map.value
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
515
|
+
.translate(width / 2, height / 2)
|
|
516
|
+
.scale(scale)
|
|
517
|
+
.translate(x, y)
|
|
518
|
+
return map.value
|
|
519
|
+
?.style('--map-scale', scale)
|
|
520
|
+
.transition()
|
|
521
|
+
.duration(props.transitionDuration)
|
|
522
|
+
.call(mapZoom.value?.transform, zoomIdentity, pointer)
|
|
523
|
+
.end()
|
|
469
524
|
}
|
|
470
525
|
|
|
471
526
|
function update() {
|
|
@@ -474,34 +529,47 @@ export default defineComponent({
|
|
|
474
529
|
return
|
|
475
530
|
}
|
|
476
531
|
// Bind a group for geojson features to path
|
|
477
|
-
map.value
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
532
|
+
map.value
|
|
533
|
+
?.append('g')
|
|
534
|
+
.attr('class', 'symbol-map__main__features')
|
|
535
|
+
.selectAll('.symbol-map__main__features__item')
|
|
536
|
+
.data(featuresGeojson.value.features)
|
|
537
|
+
// Add the path with the correct class
|
|
538
|
+
.enter()
|
|
539
|
+
.append('path')
|
|
540
|
+
.attr('class', featureClass)
|
|
541
|
+
.attr('d', featurePath.value)
|
|
542
|
+
.on('click', featureClicked)
|
|
543
|
+
.style('color', props.featureColor)
|
|
488
544
|
}
|
|
489
545
|
|
|
490
546
|
//watch
|
|
491
|
-
watch(
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
watch(
|
|
499
|
-
|
|
500
|
-
|
|
547
|
+
watch(
|
|
548
|
+
() => props.data,
|
|
549
|
+
() => {
|
|
550
|
+
//draw()
|
|
551
|
+
update()
|
|
552
|
+
}
|
|
553
|
+
)
|
|
554
|
+
watch(
|
|
555
|
+
() => props.socialMode,
|
|
556
|
+
() => {
|
|
557
|
+
draw()
|
|
558
|
+
}
|
|
559
|
+
)
|
|
560
|
+
watch(
|
|
561
|
+
() => markerCursor.value,
|
|
562
|
+
() => {
|
|
563
|
+
setMarkersClasses()
|
|
564
|
+
}
|
|
565
|
+
)
|
|
501
566
|
|
|
502
|
-
watch(
|
|
503
|
-
|
|
504
|
-
|
|
567
|
+
watch(
|
|
568
|
+
() => categoryHighlight.value,
|
|
569
|
+
() => {
|
|
570
|
+
setMarkersClasses()
|
|
571
|
+
}
|
|
572
|
+
)
|
|
505
573
|
|
|
506
574
|
return {
|
|
507
575
|
el,
|
|
@@ -516,36 +584,35 @@ export default defineComponent({
|
|
|
516
584
|
}
|
|
517
585
|
}
|
|
518
586
|
})
|
|
519
|
-
|
|
520
587
|
</script>
|
|
521
588
|
|
|
522
589
|
<template>
|
|
523
590
|
<div ref="el" :class="mapClass" class="symbol-map">
|
|
524
591
|
<slot name="legend" v-bind="{ legendData }">
|
|
525
592
|
<ordinal-legend
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
593
|
+
v-if="!hideLegend && legendData"
|
|
594
|
+
v-model:highlight="categoryHighlight"
|
|
595
|
+
:data="legendData"
|
|
596
|
+
:horizontal="horizontalLegend"
|
|
597
|
+
:marker-path="markerPath"
|
|
598
|
+
category-objects-path="label"
|
|
532
599
|
>
|
|
533
600
|
<template #marker="d">
|
|
534
|
-
<slot name="legend-marker" v-bind="d"/>
|
|
601
|
+
<slot name="legend-marker" v-bind="d" />
|
|
535
602
|
</template>
|
|
536
603
|
<template #label="d">
|
|
537
|
-
<slot name="legend-label" v-bind="d"/>
|
|
604
|
+
<slot name="legend-label" v-bind="d" />
|
|
538
605
|
</template>
|
|
539
606
|
</ordinal-legend>
|
|
540
607
|
</slot>
|
|
541
|
-
<svg class="symbol-map__main"/>
|
|
608
|
+
<svg class="symbol-map__main" />
|
|
542
609
|
<b-tooltip
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
610
|
+
v-if="tooltipTarget"
|
|
611
|
+
ref="marker-tooltip"
|
|
612
|
+
:custom-class="tooltipCustomClass"
|
|
613
|
+
:fallback-placement="tooltipFallbackPlacement"
|
|
614
|
+
:placement="tooltipPlacement"
|
|
615
|
+
:target="tooltipTarget"
|
|
549
616
|
>
|
|
550
617
|
<slot name="tooltip" v-bind="{ markerCursor, ...markerCursorValue }">
|
|
551
618
|
{{ markerLabel(markerCursorValue) }}
|
|
@@ -561,7 +628,9 @@ export default defineComponent({
|
|
|
561
628
|
.symbol-map {
|
|
562
629
|
$muted-item-opacity: 0.2;
|
|
563
630
|
$muted-item-filter: grayscale(30%) brightness(10%);
|
|
564
|
-
$muted-item-transition:
|
|
631
|
+
$muted-item-transition:
|
|
632
|
+
opacity 0.2s,
|
|
633
|
+
filter 0.2s;
|
|
565
634
|
|
|
566
635
|
$colors: $primary, $info, $warning, $danger;
|
|
567
636
|
$quantile: 2;
|
|
@@ -590,7 +659,9 @@ export default defineComponent({
|
|
|
590
659
|
stroke: currentColor;
|
|
591
660
|
stroke-width: calc(1px / var(--map-scale, 1));
|
|
592
661
|
fill: currentColor;
|
|
593
|
-
transition:
|
|
662
|
+
transition:
|
|
663
|
+
opacity 750ms,
|
|
664
|
+
filter 750ms;
|
|
594
665
|
}
|
|
595
666
|
|
|
596
667
|
&:deep(.symbol-map__main__markers) {
|
|
@@ -2,4 +2,4 @@ declare module 'bootstrap-vue/esm/components/dropdown/dropdown-item'
|
|
|
2
2
|
declare module 'bootstrap-vue/esm/components/modal/modal'
|
|
3
3
|
declare module 'bootstrap-vue/esm/components/nav/nav-item-dropdown'
|
|
4
4
|
declare module 'bootstrap-vue/esm/components/popover/popover'
|
|
5
|
-
declare module 'bootstrap-vue/esm/components/tooltip/tooltip'
|
|
5
|
+
declare module 'bootstrap-vue/esm/components/tooltip/tooltip'
|
package/lib/shims-vue.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare module 'vue' {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
declare module '*.vue' {
|
|
11
|
-
import type {DefineComponent} from 'vue'
|
|
12
|
-
const component: DefineComponent<{}, {}, any
|
|
13
|
-
export default component
|
|
11
|
+
import type { DefineComponent } from 'vue'
|
|
12
|
+
const component: DefineComponent<{}, {}, any>
|
|
13
|
+
export default component
|
|
14
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use 'sass:math';
|
|
2
2
|
/*------------------------
|
|
3
3
|
mixin that calculates if text needs to be light or dark
|
|
4
4
|
depending on the background color passed.
|
|
@@ -8,13 +8,17 @@ Color brightness is determined by the following formula:
|
|
|
8
8
|
------------------------*/
|
|
9
9
|
|
|
10
10
|
@function text-contrast($n) {
|
|
11
|
-
$color-brightness: round(
|
|
12
|
-
|
|
11
|
+
$color-brightness: round(
|
|
12
|
+
(red($n) * 299) + (green($n) * 587) + math.div(blue($n) * 114, 1000)
|
|
13
|
+
);
|
|
14
|
+
$light-color: round(
|
|
15
|
+
(red(#ffffff) * 299) + (green(#ffffff) * 587) +
|
|
16
|
+
math.div(blue(#ffffff) * 114, 1000)
|
|
17
|
+
);
|
|
13
18
|
|
|
14
|
-
@if abs($color-brightness) < ($light-color * 0.5){
|
|
19
|
+
@if abs($color-brightness) < ($light-color * 0.5) {
|
|
15
20
|
@return white;
|
|
16
|
-
}
|
|
17
|
-
@else {
|
|
21
|
+
} @else {
|
|
18
22
|
@return black;
|
|
19
23
|
}
|
|
20
24
|
}
|