1 | import { __extends } from "tslib";
|
2 | import { getXDimensionLength } from '../util/coordinate';
|
3 | import Geometry from './base';
|
4 |
|
5 | import './shape/schema';
|
6 | import { getDefaultSize } from './util/shape-size';
|
7 |
|
8 |
|
9 |
|
10 | var Schema = (function (_super) {
|
11 | __extends(Schema, _super);
|
12 | function Schema() {
|
13 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
14 | _this.type = 'schema';
|
15 | _this.shapeType = 'schema';
|
16 | _this.generatePoints = true;
|
17 | return _this;
|
18 | }
|
19 | |
20 |
|
21 |
|
22 |
|
23 |
|
24 | Schema.prototype.createShapePointsCfg = function (record) {
|
25 | var cfg = _super.prototype.createShapePointsCfg.call(this, record);
|
26 |
|
27 | var size;
|
28 | var sizeAttr = this.getAttribute('size');
|
29 | if (sizeAttr) {
|
30 | size = this.getAttributeValues(sizeAttr, record)[0];
|
31 |
|
32 | var coordinate = this.coordinate;
|
33 | var coordinateWidth = getXDimensionLength(coordinate);
|
34 | size = size / coordinateWidth;
|
35 | }
|
36 | else {
|
37 | if (!this.defaultSize) {
|
38 | this.defaultSize = getDefaultSize(this);
|
39 | }
|
40 | size = this.defaultSize;
|
41 | }
|
42 | cfg.size = size;
|
43 | return cfg;
|
44 | };
|
45 | return Schema;
|
46 | }(Geometry));
|
47 | export default Schema;
|
48 |
|
\ | No newline at end of file |