chore(@omiu/chart): rebuild & publish
This commit is contained in:
parent
120972be75
commit
6a901f9267
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@omiu/chart",
|
||||
"version": "0.0.4",
|
||||
"version": "0.0.5",
|
||||
"description": "Mobile pop-up options list",
|
||||
"docsExtend": {
|
||||
"cnName": "图表",
|
||||
|
@ -15,7 +15,7 @@
|
|||
"scripts": {
|
||||
"docs": "node ./scripts/docs-gen.js",
|
||||
"start": "node ./scripts/webpack.build.js -- demo",
|
||||
"build": "node ./scripts/webpack.build.js -- build && rollup -c scripts/rollup.config.js && node ./scripts/rollup.end.js"
|
||||
"build": "node ./scripts/webpack.build.js -- build && rollup -c scripts/rollup.config.js"
|
||||
},
|
||||
"typings": "./dist/index.d.ts",
|
||||
"repository": {
|
||||
|
@ -99,4 +99,4 @@
|
|||
"chart.js": "^3.5.0",
|
||||
"omi": "latest"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -23,12 +23,12 @@ export default {
|
|||
nodeResolve({
|
||||
main: true
|
||||
}),
|
||||
scss({
|
||||
//output: false,
|
||||
output: function (styles, styleNodes) {
|
||||
fs.writeFileSync('./src/index.css', styles)
|
||||
},
|
||||
}),
|
||||
// scss({
|
||||
// //output: false,
|
||||
// output: function (styles, styleNodes) {
|
||||
// fs.writeFileSync('./src/index.css', styles)
|
||||
// },
|
||||
// }),
|
||||
typescript(),
|
||||
commonjs(),
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
const fs = require('fs')
|
||||
|
||||
const css = fs.readFileSync('./src/index.css')
|
||||
|
||||
const js = fs.readFileSync('./src/index.esm.js', 'utf-8')
|
||||
|
||||
|
||||
fs.writeFileSync('./src/index.esm.js',
|
||||
js.replace(`var css = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null
|
||||
});`, `
|
||||
var css = \`${css}\`
|
||||
`)
|
||||
)
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
undefined
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @omiu/chart v0.0.4 http://omijs.org
|
||||
* @omiu/chart v0.0.5 http://omijs.org
|
||||
* Front End Cross-Frameworks Framework.
|
||||
* By dntzhang https://github.com/dntzhang
|
||||
* Github: https://github.com/Tencent/omi
|
||||
|
@ -10,18 +10,18 @@ import { h, tag, WeElement } from 'omi';
|
|||
import { Chart, ArcElement, LineElement, BarElement, PointElement, BarController, BubbleController, DoughnutController, LineController, PieController, PolarAreaController, RadarController, ScatterController, CategoryScale, LinearScale, LogarithmicScale, RadialLinearScale, TimeScale, TimeSeriesScale, Decimation, Filler, Legend, Title, Tooltip } from 'chart.js';
|
||||
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
/* global Reflect, Promise */
|
||||
|
||||
|
@ -45,177 +45,177 @@ function __decorate(decorators, target, key, desc) {
|
|||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
}
|
||||
|
||||
Chart.register(ArcElement, LineElement, BarElement, PointElement, BarController, BubbleController, DoughnutController, LineController, PieController, PolarAreaController, RadarController, ScatterController, CategoryScale, LinearScale, LogarithmicScale, RadialLinearScale, TimeScale, TimeSeriesScale, Decimation, Filler, Legend, Title, Tooltip);
|
||||
var ChartBase = /** @class */ (function (_super) {
|
||||
__extends(ChartBase, _super);
|
||||
function ChartBase() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this._refCanvas = function (e) { _this.canvas = e; };
|
||||
return _this;
|
||||
}
|
||||
ChartBase.prototype.receiveProps = function (props) {
|
||||
this.chart.data = props.data;
|
||||
this.chart.options = props.options;
|
||||
this.chart.update();
|
||||
};
|
||||
ChartBase.prototype.update = function () {
|
||||
this.chart.update();
|
||||
};
|
||||
ChartBase.prototype.render = function (props) {
|
||||
return (h("div", { style: { width: props.width + 'px', height: props.height + 'px' } },
|
||||
h("canvas", { ref: this._refCanvas })));
|
||||
};
|
||||
ChartBase.propTypes = {
|
||||
data: Object,
|
||||
options: Object,
|
||||
width: Number,
|
||||
height: Number
|
||||
};
|
||||
return ChartBase;
|
||||
}(WeElement));
|
||||
/** @class */ ((function (_super) {
|
||||
__extends(Bar, _super);
|
||||
function Bar() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Bar.prototype.installed = function () {
|
||||
this.chart = new Chart(this.canvas.getContext('2d'), {
|
||||
//@ts-ignore
|
||||
type: this.props.horizontal ? 'horizontalBar' : 'bar',
|
||||
data: this.props.data,
|
||||
options: this.props.options
|
||||
});
|
||||
};
|
||||
Bar = __decorate([
|
||||
tag('o-bar')
|
||||
], Bar);
|
||||
return Bar;
|
||||
})(ChartBase));
|
||||
/** @class */ ((function (_super) {
|
||||
__extends(Line, _super);
|
||||
function Line() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Line.prototype.installed = function () {
|
||||
this.chart = new Chart(this.canvas.getContext('2d'), {
|
||||
type: 'line',
|
||||
data: this.props.data,
|
||||
options: this.props.options
|
||||
});
|
||||
};
|
||||
Line = __decorate([
|
||||
tag('o-line')
|
||||
], Line);
|
||||
return Line;
|
||||
})(ChartBase));
|
||||
/** @class */ ((function (_super) {
|
||||
__extends(Radar, _super);
|
||||
function Radar() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Radar.prototype.installed = function () {
|
||||
this.chart = new Chart(this.canvas.getContext('2d'), {
|
||||
type: 'radar',
|
||||
data: this.props.data,
|
||||
options: this.props.options
|
||||
});
|
||||
};
|
||||
Radar = __decorate([
|
||||
tag('o-radar')
|
||||
], Radar);
|
||||
return Radar;
|
||||
})(ChartBase));
|
||||
/** @class */ ((function (_super) {
|
||||
__extends(Scatter, _super);
|
||||
function Scatter() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Scatter.prototype.installed = function () {
|
||||
this.chart = new Chart(this.canvas.getContext('2d'), {
|
||||
type: 'scatter',
|
||||
data: this.props.data,
|
||||
options: this.props.options
|
||||
});
|
||||
};
|
||||
Scatter = __decorate([
|
||||
tag('o-scatter')
|
||||
], Scatter);
|
||||
return Scatter;
|
||||
})(ChartBase));
|
||||
/** @class */ ((function (_super) {
|
||||
__extends(Doughnut, _super);
|
||||
function Doughnut() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Doughnut.prototype.installed = function () {
|
||||
this.chart = new Chart(this.canvas.getContext('2d'), {
|
||||
type: 'doughnut',
|
||||
data: this.props.data,
|
||||
options: this.props.options
|
||||
});
|
||||
};
|
||||
Doughnut = __decorate([
|
||||
tag('o-doughnut')
|
||||
], Doughnut);
|
||||
return Doughnut;
|
||||
})(ChartBase));
|
||||
/** @class */ ((function (_super) {
|
||||
__extends(Pie, _super);
|
||||
function Pie() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Pie.prototype.installed = function () {
|
||||
this.chart = new Chart(this.canvas.getContext('2d'), {
|
||||
type: 'pie',
|
||||
data: this.props.data,
|
||||
options: this.props.options
|
||||
});
|
||||
};
|
||||
Pie = __decorate([
|
||||
tag('o-pie')
|
||||
], Pie);
|
||||
return Pie;
|
||||
})(ChartBase));
|
||||
/** @class */ ((function (_super) {
|
||||
__extends(PolarArea, _super);
|
||||
function PolarArea() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
PolarArea.prototype.installed = function () {
|
||||
this.chart = new Chart(this.canvas.getContext('2d'), {
|
||||
type: 'polarArea',
|
||||
data: this.props.data,
|
||||
options: this.props.options
|
||||
});
|
||||
};
|
||||
PolarArea = __decorate([
|
||||
tag('o-polar-area')
|
||||
], PolarArea);
|
||||
return PolarArea;
|
||||
})(ChartBase));
|
||||
/** @class */ ((function (_super) {
|
||||
__extends(Bubble, _super);
|
||||
function Bubble() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Bubble.prototype.installed = function () {
|
||||
//@ts-ignore
|
||||
var exp = this.props.options.elements.point.radius;
|
||||
//@ts-ignore
|
||||
this.props.options.elements.point.radius = function (context) {
|
||||
var $v = context.dataset.data[context.dataIndex].v;
|
||||
var $w = context.chart.width;
|
||||
return (new Function('$v', '$w', 'return ' + exp))($v, $w);
|
||||
};
|
||||
this.chart = new Chart(this.canvas.getContext('2d'), {
|
||||
type: 'bubble',
|
||||
data: this.props.data,
|
||||
options: this.props.options
|
||||
});
|
||||
};
|
||||
Bubble = __decorate([
|
||||
tag('o-bubble')
|
||||
], Bubble);
|
||||
return Bubble;
|
||||
})(ChartBase));
|
||||
Chart.register(ArcElement, LineElement, BarElement, PointElement, BarController, BubbleController, DoughnutController, LineController, PieController, PolarAreaController, RadarController, ScatterController, CategoryScale, LinearScale, LogarithmicScale, RadialLinearScale, TimeScale, TimeSeriesScale, Decimation, Filler, Legend, Title, Tooltip);
|
||||
var ChartBase = /** @class */ (function (_super) {
|
||||
__extends(ChartBase, _super);
|
||||
function ChartBase() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this._refCanvas = function (e) { _this.canvas = e; };
|
||||
return _this;
|
||||
}
|
||||
ChartBase.prototype.receiveProps = function (props) {
|
||||
this.chart.data = props.data;
|
||||
this.chart.options = props.options;
|
||||
this.chart.update();
|
||||
};
|
||||
ChartBase.prototype.update = function () {
|
||||
this.chart.update();
|
||||
};
|
||||
ChartBase.prototype.render = function (props) {
|
||||
return (h("div", { style: { width: props.width + 'px', height: props.height + 'px' } },
|
||||
h("canvas", { ref: this._refCanvas })));
|
||||
};
|
||||
ChartBase.propTypes = {
|
||||
data: Object,
|
||||
options: Object,
|
||||
width: Number,
|
||||
height: Number
|
||||
};
|
||||
return ChartBase;
|
||||
}(WeElement));
|
||||
var Bar = /** @class */ (function (_super) {
|
||||
__extends(Bar, _super);
|
||||
function Bar() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Bar.prototype.installed = function () {
|
||||
this.chart = new Chart(this.canvas.getContext('2d'), {
|
||||
//@ts-ignore
|
||||
type: this.props.horizontal ? 'horizontalBar' : 'bar',
|
||||
data: this.props.data,
|
||||
options: this.props.options
|
||||
});
|
||||
};
|
||||
Bar = __decorate([
|
||||
tag('o-bar')
|
||||
], Bar);
|
||||
return Bar;
|
||||
}(ChartBase));
|
||||
var Line = /** @class */ (function (_super) {
|
||||
__extends(Line, _super);
|
||||
function Line() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Line.prototype.installed = function () {
|
||||
this.chart = new Chart(this.canvas.getContext('2d'), {
|
||||
type: 'line',
|
||||
data: this.props.data,
|
||||
options: this.props.options
|
||||
});
|
||||
};
|
||||
Line = __decorate([
|
||||
tag('o-line')
|
||||
], Line);
|
||||
return Line;
|
||||
}(ChartBase));
|
||||
var Radar = /** @class */ (function (_super) {
|
||||
__extends(Radar, _super);
|
||||
function Radar() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Radar.prototype.installed = function () {
|
||||
this.chart = new Chart(this.canvas.getContext('2d'), {
|
||||
type: 'radar',
|
||||
data: this.props.data,
|
||||
options: this.props.options
|
||||
});
|
||||
};
|
||||
Radar = __decorate([
|
||||
tag('o-radar')
|
||||
], Radar);
|
||||
return Radar;
|
||||
}(ChartBase));
|
||||
var Scatter = /** @class */ (function (_super) {
|
||||
__extends(Scatter, _super);
|
||||
function Scatter() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Scatter.prototype.installed = function () {
|
||||
this.chart = new Chart(this.canvas.getContext('2d'), {
|
||||
type: 'scatter',
|
||||
data: this.props.data,
|
||||
options: this.props.options
|
||||
});
|
||||
};
|
||||
Scatter = __decorate([
|
||||
tag('o-scatter')
|
||||
], Scatter);
|
||||
return Scatter;
|
||||
}(ChartBase));
|
||||
var Doughnut = /** @class */ (function (_super) {
|
||||
__extends(Doughnut, _super);
|
||||
function Doughnut() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Doughnut.prototype.installed = function () {
|
||||
this.chart = new Chart(this.canvas.getContext('2d'), {
|
||||
type: 'doughnut',
|
||||
data: this.props.data,
|
||||
options: this.props.options
|
||||
});
|
||||
};
|
||||
Doughnut = __decorate([
|
||||
tag('o-doughnut')
|
||||
], Doughnut);
|
||||
return Doughnut;
|
||||
}(ChartBase));
|
||||
var Pie = /** @class */ (function (_super) {
|
||||
__extends(Pie, _super);
|
||||
function Pie() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Pie.prototype.installed = function () {
|
||||
this.chart = new Chart(this.canvas.getContext('2d'), {
|
||||
type: 'pie',
|
||||
data: this.props.data,
|
||||
options: this.props.options
|
||||
});
|
||||
};
|
||||
Pie = __decorate([
|
||||
tag('o-pie')
|
||||
], Pie);
|
||||
return Pie;
|
||||
}(ChartBase));
|
||||
var PolarArea = /** @class */ (function (_super) {
|
||||
__extends(PolarArea, _super);
|
||||
function PolarArea() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
PolarArea.prototype.installed = function () {
|
||||
this.chart = new Chart(this.canvas.getContext('2d'), {
|
||||
type: 'polarArea',
|
||||
data: this.props.data,
|
||||
options: this.props.options
|
||||
});
|
||||
};
|
||||
PolarArea = __decorate([
|
||||
tag('o-polar-area')
|
||||
], PolarArea);
|
||||
return PolarArea;
|
||||
}(ChartBase));
|
||||
var Bubble = /** @class */ (function (_super) {
|
||||
__extends(Bubble, _super);
|
||||
function Bubble() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Bubble.prototype.installed = function () {
|
||||
//@ts-ignore
|
||||
var exp = this.props.options.elements.point.radius;
|
||||
//@ts-ignore
|
||||
this.props.options.elements.point.radius = function (context) {
|
||||
var $v = context.dataset.data[context.dataIndex].v;
|
||||
var $w = context.chart.width;
|
||||
return (new Function('$v', '$w', 'return ' + exp))($v, $w);
|
||||
};
|
||||
this.chart = new Chart(this.canvas.getContext('2d'), {
|
||||
type: 'bubble',
|
||||
data: this.props.data,
|
||||
options: this.props.options
|
||||
});
|
||||
};
|
||||
Bubble = __decorate([
|
||||
tag('o-bubble')
|
||||
], Bubble);
|
||||
return Bubble;
|
||||
}(ChartBase));
|
||||
//# sourceMappingURL=index.esm.js.map
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -20,7 +20,7 @@
|
|||
"@omiu/button": "^0.0.10",
|
||||
"@omiu/card": "0.0.8",
|
||||
"@omiu/cascader": "^0.0.5",
|
||||
"@omiu/chart": "^0.0.4",
|
||||
"@omiu/chart": "^0.0.5",
|
||||
"@omiu/chart-card": "^0.0.7",
|
||||
"@omiu/checkbox": "^0.0.13",
|
||||
"@omiu/color-picker": "^0.0.4",
|
||||
|
|
Loading…
Reference in New Issue