@genspectrum/dashboard-components 0.10.1 → 0.10.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.
Files changed (46) hide show
  1. package/custom-elements.json +23 -23
  2. package/dist/assets/{mutationOverTimeWorker-CvZg52rf.js.map → mutationOverTimeWorker-Di6yP1e6.js.map} +1 -1
  3. package/dist/components.d.ts +50 -48
  4. package/dist/components.js +151 -62
  5. package/dist/components.js.map +1 -1
  6. package/dist/{utilEntrypoint-g4DsyhU7.js → dateRangeOption-du8H7LWu.js} +33 -2
  7. package/dist/dateRangeOption-du8H7LWu.js.map +1 -0
  8. package/dist/util.d.ts +101 -59
  9. package/dist/util.js +3 -2
  10. package/package.json +1 -1
  11. package/src/preact/components/color-scale-selector.tsx +7 -3
  12. package/src/preact/components/error-boundary.tsx +39 -5
  13. package/src/preact/components/error-display.tsx +40 -5
  14. package/src/preact/dateRangeSelector/computeInitialValues.spec.ts +8 -2
  15. package/src/preact/dateRangeSelector/computeInitialValues.ts +6 -0
  16. package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +16 -2
  17. package/src/preact/dateRangeSelector/date-range-selector.tsx +20 -15
  18. package/src/preact/dateRangeSelector/dateRangeOption.ts +10 -5
  19. package/src/preact/lineageFilter/lineage-filter.stories.tsx +18 -4
  20. package/src/preact/lineageFilter/lineage-filter.tsx +15 -10
  21. package/src/preact/locationFilter/location-filter.stories.tsx +14 -0
  22. package/src/preact/locationFilter/location-filter.tsx +15 -10
  23. package/src/preact/mutationComparison/mutation-comparison-venn.tsx +17 -18
  24. package/src/preact/mutationComparison/mutation-comparison.tsx +18 -12
  25. package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutationsByDay.ts +1326 -9341
  26. package/src/preact/mutationsOverTime/__mockData__/byWeek.ts +615 -4920
  27. package/src/preact/mutationsOverTime/__mockData__/defaultMockData.ts +2203 -17624
  28. package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +16 -8
  29. package/src/preact/mutationsOverTime/mutations-over-time.tsx +1 -3
  30. package/src/preact/shared/stories/expectInvalidAttributesErrorMessage.ts +13 -0
  31. package/src/preact/webWorkers/useWebWorker.ts +8 -4
  32. package/src/query/queryMutationsOverTime.spec.ts +12 -27
  33. package/src/query/queryMutationsOverTime.ts +2 -6
  34. package/src/types.ts +19 -6
  35. package/src/utilEntrypoint.ts +8 -0
  36. package/src/utils/map2d.spec.ts +10 -10
  37. package/src/utils/map2d.ts +10 -10
  38. package/src/web-components/input/gs-date-range-selector.stories.ts +2 -2
  39. package/src/web-components/input/gs-date-range-selector.tsx +3 -3
  40. package/src/web-components/input/gs-lineage-filter.tsx +1 -1
  41. package/src/web-components/input/gs-location-filter.tsx +2 -2
  42. package/src/web-components/visualization/gs-aggregate.tsx +2 -2
  43. package/standalone-bundle/assets/{mutationOverTimeWorker-CypX_PYM.js.map → mutationOverTimeWorker-cIyshfj_.js.map} +1 -1
  44. package/standalone-bundle/dashboard-components.js +6668 -6580
  45. package/standalone-bundle/dashboard-components.js.map +1 -1
  46. package/dist/utilEntrypoint-g4DsyhU7.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"utilEntrypoint-g4DsyhU7.js","sources":["../src/preact/dateRangeSelector/dateConversion.ts","../src/preact/dateRangeSelector/dateRangeOption.ts"],"sourcesContent":["export const toYYYYMMDD = (date: Date) => {\n const options: Intl.DateTimeFormatOptions = { year: 'numeric', month: '2-digit', day: '2-digit' };\n return date.toLocaleDateString('en-CA', options);\n};\n","import { toYYYYMMDD } from './dateConversion';\n\n/**\n * A date range option that can be used in the `gs-date-range-selector` component.\n */\nexport type DateRangeOption = {\n /** The label of the date range option that will be shown to the user */\n label: string;\n /**\n * The start date of the date range in the format `YYYY-MM-DD`.\n * If not set, the date range selector will default to the `earliestDate` property.\n */\n dateFrom?: string;\n /**\n * The end date of the date range in the format `YYYY-MM-DD`.\n * If not set, the date range selector will default to the current date.\n */\n dateTo?: string;\n};\n\nexport type DateRangeSelectOption = string | { dateFrom: string; dateTo: string };\nexport class DateRangeOptionChangedEvent extends CustomEvent<DateRangeSelectOption> {\n constructor(detail: DateRangeSelectOption) {\n super('gs-date-range-option-changed', {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n\nconst today = new Date();\n\nconst twoWeeksAgo = new Date();\ntwoWeeksAgo.setDate(today.getDate() - 14);\n\nconst lastMonth = new Date(today);\nlastMonth.setMonth(today.getMonth() - 1);\n\nconst last2Months = new Date(today);\nlast2Months.setMonth(today.getMonth() - 2);\n\nconst last3Months = new Date(today);\nlast3Months.setMonth(today.getMonth() - 3);\n\nconst last6Months = new Date(today);\nlast6Months.setMonth(today.getMonth() - 6);\n\nconst lastYear = new Date(today);\nlastYear.setFullYear(today.getFullYear() - 1);\n\n/**\n * Presets for the `gs-date-range-selector` component that can be used as `dateRangeOptions`.\n */\nexport const dateRangeOptionPresets = {\n last2Weeks: {\n label: 'Last 2 weeks',\n dateFrom: toYYYYMMDD(twoWeeksAgo),\n },\n lastMonth: {\n label: 'Last month',\n dateFrom: toYYYYMMDD(lastMonth),\n },\n last2Months: {\n label: 'Last 2 months',\n dateFrom: toYYYYMMDD(last2Months),\n },\n last3Months: {\n label: 'Last 3 months',\n dateFrom: toYYYYMMDD(last3Months),\n },\n last6Months: {\n label: 'Last 6 months',\n dateFrom: toYYYYMMDD(last6Months),\n },\n lastYear: {\n label: 'Last year',\n dateFrom: toYYYYMMDD(lastYear),\n },\n allTimes: {\n label: 'All times',\n },\n} satisfies Record<string, DateRangeOption>;\n"],"names":[],"mappings":"AAAa,MAAA,aAAa,CAAC,SAAe;AACtC,QAAM,UAAsC,EAAE,MAAM,WAAW,OAAO,WAAW,KAAK;AAC/E,SAAA,KAAK,mBAAmB,SAAS,OAAO;AACnD;ACkBO,MAAM,oCAAoC,YAAmC;AAAA,EAChF,YAAY,QAA+B;AACvC,UAAM,gCAAgC;AAAA,MAClC;AAAA,MACA,SAAS;AAAA,MACT,UAAU;AAAA,IAAA,CACb;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