feat(openclaw): add shopping, supermarket deals, geizhals, and ebay MCP tools

This commit is contained in:
Moritz Graf
2026-09-10 21:32:22 +02:00
parent 2f2f597a67
commit 1e81cdbead
4754 changed files with 1298747 additions and 896 deletions
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016 Jakub Juszczak
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+129
View File
@@ -0,0 +1,129 @@
# vue-chartjs
<img align="right" width="150" height="150" alt="vue-chartjs logo" src="https://raw.githubusercontent.com/apertureless/vue-chartjs/main/assets/vue-chartjs.png">
**vue-chartjs** is a wrapper for [Chart.js](https://github.com/chartjs/Chart.js) in Vue. You can easily create reuseable chart components.
Supports Chart.js v4.
[![npm version](https://badge.fury.io/js/vue-chartjs.svg)](https://badge.fury.io/js/vue-chartjs)
[![codecov](https://codecov.io/gh/apertureless/vue-chartjs/branch/master/graph/badge.svg)](https://codecov.io/gh/apertureless/vue-chartjs)
[![Build Status](https://img.shields.io/github/actions/workflow/status/apertureless/vue-chartjs/ci.yml?branch=main)](https://github.com/apertureless/vue-chartjs/actions)
[![Package Quality](http://npm.packagequality.com/shield/vue-chartjs.svg)](http://packagequality.com/#?package=vue-chartjs)
[![npm](https://img.shields.io/npm/dm/vue-chartjs.svg)](https://www.npmjs.com/package/vue-chartjs)
[![Gitter chat](https://img.shields.io/gitter/room/TechnologyAdvice/Stardust.svg)](https://gitter.im/vue-chartjs/Lobby)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/apertureless/vue-chartjs/blob/master/LICENSE.txt)
[![CDNJS version](https://img.shields.io/cdnjs/v/vue-chartjs.svg)](https://cdnjs.com/libraries/vue-chartjs)
[![Known Vulnerabilities](https://snyk.io/test/github/apertureless/vue-chartjs/badge.svg)](https://snyk.io/test/github/apertureless/vue-chartjs)
[![Donate](https://raw.githubusercontent.com/apertureless/vue-chartjs/main/assets/donate.svg)](https://www.paypal.me/apertureless/50eur)
[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/C0C1WP7C)
<br />
<a href="#quickstart">QuickStart</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="#docs">Docs</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://stackoverflow.com/questions/tagged/vue-chartjs">Stack Overflow</a>
<br />
<hr />
## Quickstart
Install this library with peer dependencies:
```bash
pnpm add vue-chartjs chart.js
# or
yarn add vue-chartjs chart.js
# or
npm i vue-chartjs chart.js
```
Then, import and use individual components:
```vue
<template>
<Bar :data="data" :options="options" />
</template>
<script lang="ts">
import {
Chart as ChartJS,
Title,
Tooltip,
Legend,
BarElement,
CategoryScale,
LinearScale
} from 'chart.js'
import { Bar } from 'vue-chartjs'
ChartJS.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend)
export default {
name: 'App',
components: {
Bar
},
data() {
return {
data: {
labels: ['January', 'February', 'March'],
datasets: [{ data: [40, 20, 12] }]
},
options: {
responsive: true
}
}
}
}
</script>
```
<hr />
Need an API to fetch data? Consider [Cube](https://cube.dev/?ref=eco-vue-chartjs), an open-source API for data apps.
<br />
[![supported by Cube](https://user-images.githubusercontent.com/986756/154330861-d79ab8ec-aacb-4af8-9e17-1b28f1eccb01.svg)](https://cube.dev/?ref=eco-vue-chartjs)
## Docs
- [Reactivity](https://vue-chartjs.org/guide/#updating-charts)
- [Access to Chart instance](https://vue-chartjs.org/guide/#access-to-chart-instance)
- [Accessibility](https://vue-chartjs.org/guide/#accessibility)
- [Migration from v4 to v5](https://vue-chartjs.org/migration-guides/#migration-from-v4-to-v5/)
- [Migration from vue-chart-3](https://vue-chartjs.org/migration-guides/#migration-from-vue-chart-3/)
- [API](https://vue-chartjs.org/api/)
- [Examples](https://vue-chartjs.org/examples/)
## Build Setup
``` bash
# install dependencies
pnpm install
# build for production with minification
pnpm build
# run unit tests
pnpm test:unit
# run all tests
pnpm test
```
## Contributing
1. Fork it ( https://github.com/apertureless/vue-chartjs/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## License
This software is distributed under [MIT license](LICENSE.txt).
<a href="https://www.buymeacoffee.com/xcqjaytbl" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/purple_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
@@ -0,0 +1,3 @@
import type { ChartComponent } from './types.js';
export declare const Chart: ChartComponent;
//# sourceMappingURL=chart.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../src/chart.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAWhD,eAAO,MAAM,KAAK,gBA8GE,CAAA"}
+273
View File
@@ -0,0 +1,273 @@
'use strict';
var chart_js = require('chart.js');
var vue = require('vue');
const CommonProps = {
data: {
type: Object,
required: true
},
options: {
type: Object,
default: ()=>({})
},
plugins: {
type: Array,
default: ()=>[]
},
datasetIdKey: {
type: String,
default: "label"
},
updateMode: {
type: String,
default: undefined
}
};
const A11yProps = {
ariaLabel: {
type: String
},
ariaDescribedby: {
type: String
}
};
const Props = {
type: {
type: String,
required: true
},
destroyDelay: {
type: Number,
default: 0 // No delay by default
},
...CommonProps,
...A11yProps
};
const compatProps = vue.version[0] === "2" ? (internals, props)=>Object.assign(internals, {
attrs: props
}) : (internals, props)=>Object.assign(internals, props);
function toRawIfProxy(obj) {
return vue.isProxy(obj) ? vue.toRaw(obj) : obj;
}
function cloneProxy(obj) {
let src = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : obj;
return vue.isProxy(src) ? new Proxy(obj, {}) : obj;
}
function setOptions(chart, nextOptions) {
const options = chart.options;
if (options && nextOptions) {
Object.assign(options, nextOptions);
}
}
function setLabels(currentData, nextLabels) {
currentData.labels = nextLabels;
}
function setDatasets(currentData, nextDatasets, datasetIdKey) {
const addedDatasets = [];
currentData.datasets = nextDatasets.map((nextDataset)=>{
// given the new set, find it's current match
const currentDataset = currentData.datasets.find((dataset)=>dataset[datasetIdKey] === nextDataset[datasetIdKey]);
// There is no original to update, so simply add new one
if (!currentDataset || !nextDataset.data || addedDatasets.includes(currentDataset)) {
return {
...nextDataset
};
}
addedDatasets.push(currentDataset);
Object.assign(currentDataset, nextDataset);
return currentDataset;
});
}
function cloneData(data, datasetIdKey) {
const nextData = {
labels: [],
datasets: []
};
setLabels(nextData, data.labels);
setDatasets(nextData, data.datasets, datasetIdKey);
return nextData;
}
/**
* Get dataset from mouse click event
* @param chart - Chart.js instance
* @param event - Mouse click event
* @returns Dataset
*/ function getDatasetAtEvent(chart, event) {
return chart.getElementsAtEventForMode(event, "dataset", {
intersect: true
}, false);
}
/**
* Get single dataset element from mouse click event
* @param chart - Chart.js instance
* @param event - Mouse click event
* @returns Dataset
*/ function getElementAtEvent(chart, event) {
return chart.getElementsAtEventForMode(event, "nearest", {
intersect: true
}, false);
}
/**
* Get all dataset elements from mouse click event
* @param chart - Chart.js instance
* @param event - Mouse click event
* @returns Dataset
*/ function getElementsAtEvent(chart, event) {
return chart.getElementsAtEventForMode(event, "index", {
intersect: true
}, false);
}
const Chart = vue.defineComponent({
props: Props,
setup (props, param) {
let { expose , slots } = param;
const canvasRef = vue.ref(null);
const chartRef = vue.shallowRef(null);
expose({
chart: chartRef
});
const renderChart = ()=>{
if (!canvasRef.value) return;
const { type , data , options , plugins , datasetIdKey } = props;
const clonedData = cloneData(data, datasetIdKey);
const proxiedData = cloneProxy(clonedData, data);
chartRef.value = new chart_js.Chart(canvasRef.value, {
type,
data: proxiedData,
options: {
...options
},
plugins
});
};
const destroyChart = ()=>{
const chart = vue.toRaw(chartRef.value);
if (chart) {
if (props.destroyDelay > 0) {
setTimeout(()=>{
chart.destroy();
chartRef.value = null;
}, props.destroyDelay);
} else {
chart.destroy();
chartRef.value = null;
}
}
};
const update = (chart)=>{
chart.update(props.updateMode);
};
vue.onMounted(renderChart);
vue.onUnmounted(destroyChart);
vue.watch([
()=>props.options,
()=>props.data
], (param, param1)=>{
let [nextOptionsProxy, nextDataProxy] = param, [prevOptionsProxy, prevDataProxy] = param1;
const chart = vue.toRaw(chartRef.value);
if (!chart) {
return;
}
let shouldUpdate = false;
if (nextOptionsProxy) {
const nextOptions = toRawIfProxy(nextOptionsProxy);
const prevOptions = toRawIfProxy(prevOptionsProxy);
if (nextOptions && nextOptions !== prevOptions) {
setOptions(chart, nextOptions);
shouldUpdate = true;
}
}
if (nextDataProxy) {
const nextLabels = toRawIfProxy(nextDataProxy.labels);
const prevLabels = toRawIfProxy(prevDataProxy.labels);
const nextDatasets = toRawIfProxy(nextDataProxy.datasets);
const prevDatasets = toRawIfProxy(prevDataProxy.datasets);
if (nextLabels !== prevLabels) {
setLabels(chart.config.data, nextLabels);
shouldUpdate = true;
}
if (nextDatasets && nextDatasets !== prevDatasets) {
setDatasets(chart.config.data, nextDatasets, props.datasetIdKey);
shouldUpdate = true;
}
}
if (shouldUpdate) {
vue.nextTick(()=>{
update(chart);
});
}
}, {
deep: true
});
return ()=>{
return vue.h("canvas", {
role: "img",
"aria-label": props.ariaLabel,
"aria-describedby": props.ariaDescribedby,
ref: canvasRef
}, [
vue.h("p", {}, [
slots.default ? slots.default() : ""
])
]);
};
}
});
function createTypedChart(type, registerables) {
chart_js.Chart.register(registerables);
return vue.defineComponent({
props: CommonProps,
setup (props, param) {
let { expose } = param;
const chart = vue.shallowRef(null);
const chartComponentRef = vue.shallowRef(null);
vue.watch(()=>chartComponentRef.value?.chart ?? null, (nextChart)=>{
chart.value = nextChart;
}, {
flush: "sync"
});
expose({
chart
});
const reforwardRef = (instance)=>{
chartComponentRef.value = instance;
};
return ()=>{
return vue.h(Chart, compatProps({
ref: reforwardRef
}, {
type,
...props
}));
};
}
});
}
const Bar = /* #__PURE__ */ createTypedChart("bar", chart_js.BarController);
const Doughnut = /* #__PURE__ */ createTypedChart("doughnut", chart_js.DoughnutController);
const Line = /* #__PURE__ */ createTypedChart("line", chart_js.LineController);
const Pie = /* #__PURE__ */ createTypedChart("pie", chart_js.PieController);
const PolarArea = /* #__PURE__ */ createTypedChart("polarArea", chart_js.PolarAreaController);
const Radar = /* #__PURE__ */ createTypedChart("radar", chart_js.RadarController);
const Bubble = /* #__PURE__ */ createTypedChart("bubble", chart_js.BubbleController);
const Scatter = /* #__PURE__ */ createTypedChart("scatter", chart_js.ScatterController);
exports.Bar = Bar;
exports.Bubble = Bubble;
exports.Chart = Chart;
exports.Doughnut = Doughnut;
exports.Line = Line;
exports.Pie = Pie;
exports.PolarArea = PolarArea;
exports.Radar = Radar;
exports.Scatter = Scatter;
exports.createTypedChart = createTypedChart;
exports.getDatasetAtEvent = getDatasetAtEvent;
exports.getElementAtEvent = getElementAtEvent;
exports.getElementsAtEvent = getElementsAtEvent;
//# sourceMappingURL=index.cjs.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,6 @@
import { Chart } from './chart.js';
import { createTypedChart, Bar, Doughnut, Line, Pie, PolarArea, Radar, Bubble, Scatter } from './typedCharts.js';
export type { ChartProps, ChartComponentRef } from './types.js';
export { getDatasetAtEvent, getElementAtEvent, getElementsAtEvent } from './utils.js';
export { Chart, createTypedChart, Bar, Doughnut, Line, Pie, PolarArea, Radar, Bubble, Scatter };
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EACL,gBAAgB,EAChB,GAAG,EACH,QAAQ,EACR,IAAI,EACJ,GAAG,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,OAAO,EACR,MAAM,kBAAkB,CAAA;AAEzB,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC/D,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,KAAK,EACL,gBAAgB,EAChB,GAAG,EACH,QAAQ,EACR,IAAI,EACJ,GAAG,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,OAAO,EACR,CAAA"}
+259
View File
@@ -0,0 +1,259 @@
import { Chart as Chart$1, BarController, DoughnutController, LineController, PieController, PolarAreaController, RadarController, BubbleController, ScatterController } from 'chart.js';
import { version, isProxy, toRaw, defineComponent, ref, shallowRef, onMounted, onUnmounted, watch, nextTick, h } from 'vue';
const CommonProps = {
data: {
type: Object,
required: true
},
options: {
type: Object,
default: ()=>({})
},
plugins: {
type: Array,
default: ()=>[]
},
datasetIdKey: {
type: String,
default: "label"
},
updateMode: {
type: String,
default: undefined
}
};
const A11yProps = {
ariaLabel: {
type: String
},
ariaDescribedby: {
type: String
}
};
const Props = {
type: {
type: String,
required: true
},
destroyDelay: {
type: Number,
default: 0 // No delay by default
},
...CommonProps,
...A11yProps
};
const compatProps = version[0] === "2" ? (internals, props)=>Object.assign(internals, {
attrs: props
}) : (internals, props)=>Object.assign(internals, props);
function toRawIfProxy(obj) {
return isProxy(obj) ? toRaw(obj) : obj;
}
function cloneProxy(obj) {
let src = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : obj;
return isProxy(src) ? new Proxy(obj, {}) : obj;
}
function setOptions(chart, nextOptions) {
const options = chart.options;
if (options && nextOptions) {
Object.assign(options, nextOptions);
}
}
function setLabels(currentData, nextLabels) {
currentData.labels = nextLabels;
}
function setDatasets(currentData, nextDatasets, datasetIdKey) {
const addedDatasets = [];
currentData.datasets = nextDatasets.map((nextDataset)=>{
// given the new set, find it's current match
const currentDataset = currentData.datasets.find((dataset)=>dataset[datasetIdKey] === nextDataset[datasetIdKey]);
// There is no original to update, so simply add new one
if (!currentDataset || !nextDataset.data || addedDatasets.includes(currentDataset)) {
return {
...nextDataset
};
}
addedDatasets.push(currentDataset);
Object.assign(currentDataset, nextDataset);
return currentDataset;
});
}
function cloneData(data, datasetIdKey) {
const nextData = {
labels: [],
datasets: []
};
setLabels(nextData, data.labels);
setDatasets(nextData, data.datasets, datasetIdKey);
return nextData;
}
/**
* Get dataset from mouse click event
* @param chart - Chart.js instance
* @param event - Mouse click event
* @returns Dataset
*/ function getDatasetAtEvent(chart, event) {
return chart.getElementsAtEventForMode(event, "dataset", {
intersect: true
}, false);
}
/**
* Get single dataset element from mouse click event
* @param chart - Chart.js instance
* @param event - Mouse click event
* @returns Dataset
*/ function getElementAtEvent(chart, event) {
return chart.getElementsAtEventForMode(event, "nearest", {
intersect: true
}, false);
}
/**
* Get all dataset elements from mouse click event
* @param chart - Chart.js instance
* @param event - Mouse click event
* @returns Dataset
*/ function getElementsAtEvent(chart, event) {
return chart.getElementsAtEventForMode(event, "index", {
intersect: true
}, false);
}
const Chart = defineComponent({
props: Props,
setup (props, param) {
let { expose , slots } = param;
const canvasRef = ref(null);
const chartRef = shallowRef(null);
expose({
chart: chartRef
});
const renderChart = ()=>{
if (!canvasRef.value) return;
const { type , data , options , plugins , datasetIdKey } = props;
const clonedData = cloneData(data, datasetIdKey);
const proxiedData = cloneProxy(clonedData, data);
chartRef.value = new Chart$1(canvasRef.value, {
type,
data: proxiedData,
options: {
...options
},
plugins
});
};
const destroyChart = ()=>{
const chart = toRaw(chartRef.value);
if (chart) {
if (props.destroyDelay > 0) {
setTimeout(()=>{
chart.destroy();
chartRef.value = null;
}, props.destroyDelay);
} else {
chart.destroy();
chartRef.value = null;
}
}
};
const update = (chart)=>{
chart.update(props.updateMode);
};
onMounted(renderChart);
onUnmounted(destroyChart);
watch([
()=>props.options,
()=>props.data
], (param, param1)=>{
let [nextOptionsProxy, nextDataProxy] = param, [prevOptionsProxy, prevDataProxy] = param1;
const chart = toRaw(chartRef.value);
if (!chart) {
return;
}
let shouldUpdate = false;
if (nextOptionsProxy) {
const nextOptions = toRawIfProxy(nextOptionsProxy);
const prevOptions = toRawIfProxy(prevOptionsProxy);
if (nextOptions && nextOptions !== prevOptions) {
setOptions(chart, nextOptions);
shouldUpdate = true;
}
}
if (nextDataProxy) {
const nextLabels = toRawIfProxy(nextDataProxy.labels);
const prevLabels = toRawIfProxy(prevDataProxy.labels);
const nextDatasets = toRawIfProxy(nextDataProxy.datasets);
const prevDatasets = toRawIfProxy(prevDataProxy.datasets);
if (nextLabels !== prevLabels) {
setLabels(chart.config.data, nextLabels);
shouldUpdate = true;
}
if (nextDatasets && nextDatasets !== prevDatasets) {
setDatasets(chart.config.data, nextDatasets, props.datasetIdKey);
shouldUpdate = true;
}
}
if (shouldUpdate) {
nextTick(()=>{
update(chart);
});
}
}, {
deep: true
});
return ()=>{
return h("canvas", {
role: "img",
"aria-label": props.ariaLabel,
"aria-describedby": props.ariaDescribedby,
ref: canvasRef
}, [
h("p", {}, [
slots.default ? slots.default() : ""
])
]);
};
}
});
function createTypedChart(type, registerables) {
Chart$1.register(registerables);
return defineComponent({
props: CommonProps,
setup (props, param) {
let { expose } = param;
const chart = shallowRef(null);
const chartComponentRef = shallowRef(null);
watch(()=>chartComponentRef.value?.chart ?? null, (nextChart)=>{
chart.value = nextChart;
}, {
flush: "sync"
});
expose({
chart
});
const reforwardRef = (instance)=>{
chartComponentRef.value = instance;
};
return ()=>{
return h(Chart, compatProps({
ref: reforwardRef
}, {
type,
...props
}));
};
}
});
}
const Bar = /* #__PURE__ */ createTypedChart("bar", BarController);
const Doughnut = /* #__PURE__ */ createTypedChart("doughnut", DoughnutController);
const Line = /* #__PURE__ */ createTypedChart("line", LineController);
const Pie = /* #__PURE__ */ createTypedChart("pie", PieController);
const PolarArea = /* #__PURE__ */ createTypedChart("polarArea", PolarAreaController);
const Radar = /* #__PURE__ */ createTypedChart("radar", RadarController);
const Bubble = /* #__PURE__ */ createTypedChart("bubble", BubbleController);
const Scatter = /* #__PURE__ */ createTypedChart("scatter", ScatterController);
export { Bar, Bubble, Chart, Doughnut, Line, Pie, PolarArea, Radar, Scatter, createTypedChart, getDatasetAtEvent, getElementAtEvent, getElementsAtEvent };
//# sourceMappingURL=index.js.map
File diff suppressed because one or more lines are too long
+69
View File
@@ -0,0 +1,69 @@
import type { PropType } from 'vue';
import type { ChartData, Plugin } from 'chart.js';
export declare const CommonProps: {
readonly data: {
readonly type: PropType<ChartData<keyof import("chart.js").ChartTypeRegistry, (number | [number, number] | import("chart.js").Point | import("chart.js").BubbleDataPoint | null)[], unknown>>;
readonly required: true;
};
readonly options: {
readonly type: PropType<import("chart.js/dist/types/utils")._DeepPartialObject<import("chart.js").CoreChartOptions<keyof import("chart.js").ChartTypeRegistry> & import("chart.js").ElementChartOptions<keyof import("chart.js").ChartTypeRegistry> & import("chart.js").PluginChartOptions<keyof import("chart.js").ChartTypeRegistry> & import("chart.js").DatasetChartOptions<keyof import("chart.js").ChartTypeRegistry> & import("chart.js").ScaleChartOptions<keyof import("chart.js").ChartTypeRegistry>>>;
readonly default: () => {};
};
readonly plugins: {
readonly type: PropType<Plugin<keyof import("chart.js").ChartTypeRegistry, import("chart.js/dist/types/basic").AnyObject>[]>;
readonly default: () => never[];
};
readonly datasetIdKey: {
readonly type: StringConstructor;
readonly default: "label";
};
readonly updateMode: {
readonly type: PropType<"resize" | "reset" | "none" | "hide" | "show" | "default" | "active">;
readonly default: undefined;
};
};
export declare const A11yProps: {
readonly ariaLabel: {
readonly type: StringConstructor;
};
readonly ariaDescribedby: {
readonly type: StringConstructor;
};
};
export declare const Props: {
readonly ariaLabel: {
readonly type: StringConstructor;
};
readonly ariaDescribedby: {
readonly type: StringConstructor;
};
readonly data: {
readonly type: PropType<ChartData<keyof import("chart.js").ChartTypeRegistry, (number | [number, number] | import("chart.js").Point | import("chart.js").BubbleDataPoint | null)[], unknown>>;
readonly required: true;
};
readonly options: {
readonly type: PropType<import("chart.js/dist/types/utils")._DeepPartialObject<import("chart.js").CoreChartOptions<keyof import("chart.js").ChartTypeRegistry> & import("chart.js").ElementChartOptions<keyof import("chart.js").ChartTypeRegistry> & import("chart.js").PluginChartOptions<keyof import("chart.js").ChartTypeRegistry> & import("chart.js").DatasetChartOptions<keyof import("chart.js").ChartTypeRegistry> & import("chart.js").ScaleChartOptions<keyof import("chart.js").ChartTypeRegistry>>>;
readonly default: () => {};
};
readonly plugins: {
readonly type: PropType<Plugin<keyof import("chart.js").ChartTypeRegistry, import("chart.js/dist/types/basic").AnyObject>[]>;
readonly default: () => never[];
};
readonly datasetIdKey: {
readonly type: StringConstructor;
readonly default: "label";
};
readonly updateMode: {
readonly type: PropType<"resize" | "reset" | "none" | "hide" | "show" | "default" | "active">;
readonly default: undefined;
};
readonly type: {
readonly type: PropType<keyof import("chart.js").ChartTypeRegistry>;
readonly required: true;
};
readonly destroyDelay: {
readonly type: NumberConstructor;
readonly default: 0;
};
};
//# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../src/props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAEV,SAAS,EAET,MAAM,EAEP,MAAM,UAAU,CAAA;AAEjB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;CAqBd,CAAA;AAEV,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAA;AAEV,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWR,CAAA"}
@@ -0,0 +1,15 @@
import type { ChartType, ChartComponentLike, DefaultDataPoint } from 'chart.js';
import type { TypedChartComponent } from './types.js';
export declare function createTypedChart<TType extends ChartType = ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown>(type: TType, registerables: ChartComponentLike): TypedChartComponent<TType, TData, TLabel>;
export interface ExtendedDataPoint {
[key: string]: string | number | null | ExtendedDataPoint;
}
export declare const Bar: TypedChartComponent<"bar", (number | [number, number] | null)[] | ExtendedDataPoint[], unknown>;
export declare const Doughnut: TypedChartComponent<"doughnut", number[], unknown>;
export declare const Line: TypedChartComponent<"line", (number | import("chart.js").Point | null)[], unknown>;
export declare const Pie: TypedChartComponent<"pie", number[], unknown>;
export declare const PolarArea: TypedChartComponent<"polarArea", number[], unknown>;
export declare const Radar: TypedChartComponent<"radar", (number | null)[], unknown>;
export declare const Bubble: TypedChartComponent<"bubble", import("chart.js").BubbleDataPoint[], unknown>;
export declare const Scatter: TypedChartComponent<"scatter", (number | import("chart.js").Point | null)[], unknown>;
//# sourceMappingURL=typedCharts.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"typedCharts.d.ts","sourceRoot":"","sources":["../src/typedCharts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAa/E,OAAO,KAAK,EAAE,mBAAmB,EAAqB,MAAM,YAAY,CAAA;AAKxE,wBAAgB,gBAAgB,CAC9B,KAAK,SAAS,SAAS,GAAG,SAAS,EACnC,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,EAC/B,MAAM,GAAG,OAAO,EAEhB,IAAI,EAAE,KAAK,EACX,aAAa,EAAE,kBAAkB,GAChC,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAuC3C;AAED,MAAM,WAAW,iBAAiB;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,iBAAiB,CAAA;CAC1D;AAED,eAAO,MAAM,GAAG,iGAGO,CAAA;AAEvB,eAAO,MAAM,QAAQ,oDAGpB,CAAA;AAED,eAAO,MAAM,IAAI,oFAA2D,CAAA;AAE5E,eAAO,MAAM,GAAG,+CAAyD,CAAA;AAEzE,eAAO,MAAM,SAAS,qDAGrB,CAAA;AAED,eAAO,MAAM,KAAK,0DAA6D,CAAA;AAE/E,eAAO,MAAM,MAAM,8EAGlB,CAAA;AAED,eAAO,MAAM,OAAO,uFAGnB,CAAA"}
+41
View File
@@ -0,0 +1,41 @@
import type { DefineComponent } from 'vue';
import type { Chart as ChartJS, ChartType, ChartData, ChartOptions, DefaultDataPoint, Plugin, UpdateMode } from 'chart.js';
export interface ChartProps<TType extends ChartType = ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown> {
/**
* Chart.js chart type
*/
type: TType;
/**
* The data object that is passed into the Chart.js chart
* @see https://www.chartjs.org/docs/latest/getting-started/
*/
data: ChartData<TType, TData, TLabel>;
/**
* The options object that is passed into the Chart.js chart
* @see https://www.chartjs.org/docs/latest/general/options.html
* @default {}
*/
options?: ChartOptions<TType>;
/**
* The plugins array that is passed into the Chart.js chart
* @see https://www.chartjs.org/docs/latest/developers/plugins.html
* @default []
*/
plugins?: Plugin<TType>[];
/**
* Key name to identificate dataset
* @default 'label'
*/
datasetIdKey?: string;
/**
* A mode string to indicate transition configuration should be used.
* @see https://www.chartjs.org/docs/latest/developers/api.html#update-mode
*/
updateMode?: UpdateMode;
}
export interface ChartComponentRef<TType extends ChartType = ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown> {
chart: ChartJS<TType, TData, TLabel> | null;
}
export type ChartComponent = DefineComponent<ChartProps>;
export type TypedChartComponent<TType extends ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown> = DefineComponent<Omit<ChartProps<TType, TData, TLabel>, 'type'>>;
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,KAAK,CAAA;AAC1C,OAAO,KAAK,EACV,KAAK,IAAI,OAAO,EAChB,SAAS,EACT,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,MAAM,EACN,UAAU,EACX,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,UAAU,CACzB,KAAK,SAAS,SAAS,GAAG,SAAS,EACnC,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,EAC/B,MAAM,GAAG,OAAO;IAEhB;;OAEG;IACH,IAAI,EAAE,KAAK,CAAA;IACX;;;OAGG;IACH,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IACrC;;;;OAIG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAA;IAC7B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAA;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB;AAED,MAAM,WAAW,iBAAiB,CAChC,KAAK,SAAS,SAAS,GAAG,SAAS,EACnC,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,EAC/B,MAAM,GAAG,OAAO;IAEhB,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,IAAI,CAAA;CAC5C;AAED,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC,UAAU,CAAC,CAAA;AAExD,MAAM,MAAM,mBAAmB,CAC7B,KAAK,SAAS,SAAS,EACvB,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,EAC/B,MAAM,GAAG,OAAO,IACd,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA"}
+30
View File
@@ -0,0 +1,30 @@
import type { Chart, ChartType, ChartData, ChartDataset, ChartOptions, DefaultDataPoint } from 'chart.js';
export declare const compatProps: <I extends {}, T extends {}>(internals: I, props: T) => I & T;
export declare function toRawIfProxy<T>(obj: T): T;
export declare function cloneProxy<T extends object>(obj: T, src?: T): T;
export declare function setOptions<TType extends ChartType = ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown>(chart: Chart<TType, TData, TLabel>, nextOptions: ChartOptions<TType>): void;
export declare function setLabels<TType extends ChartType = ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown>(currentData: ChartData<TType, TData, TLabel>, nextLabels: TLabel[] | undefined): void;
export declare function setDatasets<TType extends ChartType = ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown>(currentData: ChartData<TType, TData, TLabel>, nextDatasets: ChartDataset<TType, TData>[], datasetIdKey: string): void;
export declare function cloneData<TType extends ChartType = ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown>(data: ChartData<TType, TData, TLabel>, datasetIdKey: string): ChartData<TType, TData, TLabel>;
/**
* Get dataset from mouse click event
* @param chart - Chart.js instance
* @param event - Mouse click event
* @returns Dataset
*/
export declare function getDatasetAtEvent(chart: Chart, event: MouseEvent): import("chart.js").InteractionItem[];
/**
* Get single dataset element from mouse click event
* @param chart - Chart.js instance
* @param event - Mouse click event
* @returns Dataset
*/
export declare function getElementAtEvent(chart: Chart, event: MouseEvent): import("chart.js").InteractionItem[];
/**
* Get all dataset elements from mouse click event
* @param chart - Chart.js instance
* @param event - Mouse click event
* @returns Dataset
*/
export declare function getElementsAtEvent(chart: Chart, event: MouseEvent): import("chart.js").InteractionItem[];
//# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,SAAS,EACT,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,gBAAgB,EACjB,MAAM,UAAU,CAAA;AAEjB,eAAO,MAAM,WAAW,+DAKe,CAAA;AAEvC,wBAAgB,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,KAErC;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,IAAM,KAE7D;AAED,wBAAgB,UAAU,CACxB,KAAK,SAAS,SAAS,GAAG,SAAS,EACnC,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,EAC/B,MAAM,GAAG,OAAO,EAChB,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,YAAY,CAAC,KAAK,CAAC,QAMrE;AAED,wBAAgB,SAAS,CACvB,KAAK,SAAS,SAAS,GAAG,SAAS,EACnC,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,EAC/B,MAAM,GAAG,OAAO,EAEhB,WAAW,EAAE,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,EAC5C,UAAU,EAAE,MAAM,EAAE,GAAG,SAAS,QAGjC;AAED,wBAAgB,WAAW,CACzB,KAAK,SAAS,SAAS,GAAG,SAAS,EACnC,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,EAC/B,MAAM,GAAG,OAAO,EAEhB,WAAW,EAAE,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,EAC5C,YAAY,EAAE,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAC1C,YAAY,EAAE,MAAM,QA4BrB;AAED,wBAAgB,SAAS,CACvB,KAAK,SAAS,SAAS,GAAG,SAAS,EACnC,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,EAC/B,MAAM,GAAG,OAAO,EAChB,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,MAAM,mCAU5D;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,wCAOhE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,wCAOhE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,wCAOjE"}
+60
View File
@@ -0,0 +1,60 @@
{
"name": "vue-chartjs",
"type": "module",
"version": "5.3.4",
"description": "Vue.js wrapper for chart.js for creating beautiful charts.",
"author": "Jakub Juszczak <jakub@posteo.de>",
"homepage": "http://vue-chartjs.org",
"license": "MIT",
"contributors": [
{
"name": "Thorsten Lünborg",
"web": "https://github.com/LinusBorg"
},
{
"name": "Juan Carlos Alonso",
"web": "https://github.com/jcalonso"
}
],
"maintainers": [
{
"name": "Jakub Juszczak",
"email": "jakub@posteo.de",
"web": "http://www.jakubjuszczak.de"
}
],
"repository": {
"type": "git",
"url": "git+ssh://git@github.com:apertureless/vue-chartjs.git"
},
"bugs": {
"url": "https://github.com/apertureless/vue-chartjs/issues"
},
"keywords": [
"ChartJs",
"Vue",
"Visualisation",
"Wrapper",
"Charts"
],
"sideEffects": false,
"types": "./dist/index.d.ts",
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"publishConfig": {
"directory": "package"
},
"files": [
"dist"
],
"peerDependencies": {
"chart.js": "^4.1.1",
"vue": "^3.0.0-0 || ^2.7.0"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"scripts": {}
}