@dataloop-ai/components 0.16.21 → 0.16.23
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/package.json +1 -1
- package/src/components/basic/DlAlert/DlAlert.vue +1 -1
- package/src/components/compound/DlCharts/charts/DlColumnChart/DlColumnChart.vue +12 -1
- package/src/components/compound/DlCharts/types/props.ts +1 -0
- package/src/components/compound/DlCharts/utils.ts +7 -0
- package/src/components/compound/DlToast/components/ToastComponent.vue +1 -6
- package/src/components/essential/DlIcon/DlIcon.vue +1 -1
package/package.json
CHANGED
|
@@ -101,6 +101,7 @@ import {
|
|
|
101
101
|
import type { Chart, ChartMeta, ChartDataset, ActiveElement } from 'chart.js'
|
|
102
102
|
import { unionBy, orderBy, merge, isEqual } from 'lodash'
|
|
103
103
|
import { useThemeVariables } from '../../../../../hooks/use-theme'
|
|
104
|
+
import { getMaxDatasetValue } from '../../utils'
|
|
104
105
|
|
|
105
106
|
ChartJS.register(
|
|
106
107
|
Title,
|
|
@@ -365,7 +366,17 @@ export default defineComponent({
|
|
|
365
366
|
const chartOptions = reactive(
|
|
366
367
|
updateKey(
|
|
367
368
|
merge(
|
|
368
|
-
{
|
|
369
|
+
{
|
|
370
|
+
onResize,
|
|
371
|
+
onHover,
|
|
372
|
+
scales: {
|
|
373
|
+
y: {
|
|
374
|
+
suggestedMax: getMaxDatasetValue(
|
|
375
|
+
chartData.value.datasets
|
|
376
|
+
)
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
},
|
|
369
380
|
defaultColumnChartProps.options,
|
|
370
381
|
props.options
|
|
371
382
|
),
|
|
@@ -151,3 +151,10 @@ export function getElementsAtEvent(chart: Chart, event: MouseEvent) {
|
|
|
151
151
|
false
|
|
152
152
|
)
|
|
153
153
|
}
|
|
154
|
+
|
|
155
|
+
export const getMaxDatasetValue = (chartDataset: [{ data: number[] }]) => {
|
|
156
|
+
return Math.max.apply(
|
|
157
|
+
null,
|
|
158
|
+
chartDataset.map((data) => [...data.data]).flat(1)
|
|
159
|
+
)
|
|
160
|
+
}
|
|
@@ -314,11 +314,6 @@ export default defineComponent({
|
|
|
314
314
|
--dl-color-info: var(--dl-color-alert-info);
|
|
315
315
|
--dl-color-info-background: var(--dl-color-alert-info-background);
|
|
316
316
|
--dl-color-darker: var(--dl-color-alert-text);
|
|
317
|
-
|
|
318
|
-
.alert {
|
|
319
|
-
.close-btn {
|
|
320
|
-
align-items: center !important;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
317
|
+
--dl-alert-align-button: center;
|
|
323
318
|
}
|
|
324
319
|
</style>
|
|
@@ -85,7 +85,7 @@ export default defineComponent({
|
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
inlineStyles(): string {
|
|
88
|
-
return this.inline ? 'display: inline' : ''
|
|
88
|
+
return this.inline ? 'display: inline' : 'display: flex;'
|
|
89
89
|
},
|
|
90
90
|
// needed to allow external source of icons that do not use class based
|
|
91
91
|
externalIcon(): boolean {
|