|
1 | 1 | <script setup lang="ts"> |
2 | | -import type { VueUiXyDatasetItem } from 'vue-data-ui' |
| 2 | +import type { VueUiXyConfig, VueUiXyDatasetItem } from 'vue-data-ui' |
3 | 3 | import { VueUiXy } from 'vue-data-ui/vue-ui-xy' |
4 | 4 | import { useDebounceFn, useElementSize } from '@vueuse/core' |
5 | 5 | import { useCssVariables } from '~/composables/useColors' |
@@ -1283,12 +1283,14 @@ const chartConfig = computed(() => { |
1283 | 1283 | fullscreen: false, |
1284 | 1284 | table: false, |
1285 | 1285 | tooltip: false, |
| 1286 | + altCopy: false, // TODO: set to true to enable the alt copy feature |
1286 | 1287 | }, |
1287 | 1288 | buttonTitles: { |
1288 | 1289 | csv: $t('package.trends.download_file', { fileType: 'CSV' }), |
1289 | 1290 | img: $t('package.trends.download_file', { fileType: 'PNG' }), |
1290 | 1291 | svg: $t('package.trends.download_file', { fileType: 'SVG' }), |
1291 | 1292 | annotator: $t('package.trends.toggle_annotator'), |
| 1293 | + altCopy: undefined, // TODO: set to proper translation key |
1292 | 1294 | }, |
1293 | 1295 | callbacks: { |
1294 | 1296 | img: ({ imageUri }: { imageUri: string }) => { |
@@ -1316,6 +1318,10 @@ const chartConfig = computed(() => { |
1316 | 1318 | loadFile(url, buildExportFilename('svg')) |
1317 | 1319 | URL.revokeObjectURL(url) |
1318 | 1320 | }, |
| 1321 | + // altCopy: ({ dataset: dst, config: cfg }: { dataset: Array<VueUiXyDatasetItem>; config: VueUiXyConfig}) => { |
| 1322 | + // // TODO: implement a reusable copy-alt-text-to-clipboard feature based on the dataset & configuration |
| 1323 | + // console.log({ dst, cfg}) |
| 1324 | + // } |
1319 | 1325 | }, |
1320 | 1326 | }, |
1321 | 1327 | grid: { |
@@ -1422,6 +1428,9 @@ const chartConfig = computed(() => { |
1422 | 1428 | selectedColor: accent.value, |
1423 | 1429 | selectedColorOpacity: 0.06, |
1424 | 1430 | frameColor: colors.value.border, |
| 1431 | + handleWidth: isMobile.value ? 40 : 20, // does not affect the size of the touch area |
| 1432 | + handleBorderColor: colors.value.fgSubtle, |
| 1433 | + handleType: 'grab', // 'empty' | 'chevron' | 'arrow' | 'grab' |
1425 | 1434 | }, |
1426 | 1435 | preview: { |
1427 | 1436 | fill: transparentizeOklch(accent.value, isDarkMode.value ? 0.95 : 0.92), |
@@ -1722,6 +1731,13 @@ watch(selectedMetric, value => { |
1722 | 1731 | aria-hidden="true" |
1723 | 1732 | /> |
1724 | 1733 | </template> |
| 1734 | + <template #optionAltCopy> |
| 1735 | + <span |
| 1736 | + class="i-carbon:accessibility-alt w-6 h-6 text-fg-subtle" |
| 1737 | + style="pointer-events: none" |
| 1738 | + aria-hidden="true" |
| 1739 | + /> |
| 1740 | + </template> |
1725 | 1741 | </VueUiXy> |
1726 | 1742 | </div> |
1727 | 1743 |
|
@@ -1768,7 +1784,7 @@ watch(selectedMetric, value => { |
1768 | 1784 | @media screen and (min-width: 767px) { |
1769 | 1785 | #trends-chart .vue-data-ui-refresh-button { |
1770 | 1786 | top: -0.6rem !important; |
1771 | | - left: calc(100% + 2rem) !important; |
| 1787 | + left: calc(100% + 4rem) !important; |
1772 | 1788 | } |
1773 | 1789 | } |
1774 | 1790 |
|
|
0 commit comments