@geolonia/embed 6.0.0-pre.5 → 6.0.0-pre.6
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/.pinact.yml +5 -2
- package/CHANGELOG.md +15 -0
- package/dist/embed +1 -1
- package/dist/embed-chunks/5fc1f8cd252efa958f7d.js +2 -0
- package/dist/embed-chunks/64c22ed093c8de0fcbf8.js +2 -0
- package/dist/embed-core.js +1 -1
- package/dist/embed.js +1 -1
- package/dist/types.d.ts +34 -0
- package/dist/version.d.ts +1 -1
- package/e2e/data-driven.spec.ts +61 -0
- package/package.json +2 -2
- package/src/lib/parse-atts.test.ts +146 -0
- package/src/lib/parse-atts.ts +102 -1
- package/src/types.ts +34 -0
- package/src/version.ts +1 -1
- package/dist/embed-chunks/00ecbfa5ec913dd002fb.js +0 -2
- package/dist/embed-chunks/52e84382012e7ba206d5.js +0 -2
- /package/dist/embed-chunks/{00ecbfa5ec913dd002fb.js.LICENSE.txt → 5fc1f8cd252efa958f7d.js.LICENSE.txt} +0 -0
- /package/dist/embed-chunks/{52e84382012e7ba206d5.js.LICENSE.txt → 64c22ed093c8de0fcbf8.js.LICENSE.txt} +0 -0
package/dist/types.d.ts
CHANGED
|
@@ -170,6 +170,40 @@ export type EmbedAttributes = {
|
|
|
170
170
|
* @defaultValue `''`(off として扱われる)
|
|
171
171
|
*/
|
|
172
172
|
'3d': string;
|
|
173
|
+
/**
|
|
174
|
+
* `data-choropleth`:`data-geojson` のポリゴンを、このプロパティの値で塗り分ける。
|
|
175
|
+
* 既定値はなく、指定したときだけキーが入る。
|
|
176
|
+
*/
|
|
177
|
+
choropleth?: string;
|
|
178
|
+
/**
|
|
179
|
+
* `data-choropleth-colors`:塗り分けの色。値の小さい側から順にカンマで区切る。
|
|
180
|
+
* `data-choropleth` が無いときは無視する。
|
|
181
|
+
*/
|
|
182
|
+
choroplethColors?: string;
|
|
183
|
+
/**
|
|
184
|
+
* `data-choropleth-range`:色を割り当てる値の範囲。`"最小,最大"` 形式。
|
|
185
|
+
* 省略時や読めないときはデータの最小値と最大値を使う。
|
|
186
|
+
*/
|
|
187
|
+
choroplethRange?: string;
|
|
188
|
+
/**
|
|
189
|
+
* `data-heatmap`:`data-geojson` のポイントをヒートマップで描く。`'on'` で重みなし、
|
|
190
|
+
* プロパティ名でその値を重みにする。`'off'` または空なら描かない。
|
|
191
|
+
*/
|
|
192
|
+
heatmap?: string;
|
|
193
|
+
/**
|
|
194
|
+
* `data-heatmap-colors`:ヒートマップの色。密度の低い側から順にカンマで区切る。
|
|
195
|
+
* `data-heatmap` が無いときは無視する。
|
|
196
|
+
*/
|
|
197
|
+
heatmapColors?: string;
|
|
198
|
+
/** `data-circle-size`:ポイントの円の大きさに使うプロパティ名。 */
|
|
199
|
+
circleSize?: string;
|
|
200
|
+
/** `data-circle-color`:ポイントの円の色に使うプロパティ名。 */
|
|
201
|
+
circleColor?: string;
|
|
202
|
+
/**
|
|
203
|
+
* `data-circle-colors`:`data-circle-color` に使う色をカンマで区切る。
|
|
204
|
+
* `data-circle-size` と `data-circle-color` のどちらも無いときは無視する。
|
|
205
|
+
*/
|
|
206
|
+
circleColors?: string;
|
|
173
207
|
/**
|
|
174
208
|
* 追加の `data-*` 属性はそのまま透過される({@link EmbedPlugin} が利用する
|
|
175
209
|
* プラグイン固有の属性など)。
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "6.0.0-pre.
|
|
1
|
+
export declare const VERSION = "6.0.0-pre.6";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { test, expect } from '@playwright/test';
|
|
2
|
+
import { TEST_URL, mockGeoloniaTiles, waitForStyleLoad, hasLayer } from './helper';
|
|
3
|
+
|
|
4
|
+
// embed (wrapper) 固有: data-choropleth / data-heatmap / data-circle-* を読んで
|
|
5
|
+
// maps-core の choropleth / heatmap / circle オプションへ渡す (embed#546)。
|
|
6
|
+
// 式がどう描かれるか (option → 描画) は maps-core 側 E2E (maps-core#156) が担保する。
|
|
7
|
+
// ここでは、属性で指定したプロパティ名と色がレイヤーの paint に届き、MapLibre が
|
|
8
|
+
// その式を受け付ける (error イベントもページのエラーも出ない) ことを見る。
|
|
9
|
+
test.describe('data-choropleth / data-heatmap / data-circle-* フォワーディング (wrapper-only)', () => {
|
|
10
|
+
let pageErrors: string[];
|
|
11
|
+
|
|
12
|
+
test.beforeEach(async ({ page }) => {
|
|
13
|
+
pageErrors = [];
|
|
14
|
+
page.on('pageerror', (error) => pageErrors.push(error.message));
|
|
15
|
+
page.on('console', (message) => {
|
|
16
|
+
if (message.type() === 'error') pageErrors.push(message.text());
|
|
17
|
+
});
|
|
18
|
+
await mockGeoloniaTiles(page);
|
|
19
|
+
await page.goto(`${TEST_URL}/data-driven.html`);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
for (const [selector, layer, property, expected] of [
|
|
23
|
+
['#choropleth', 'geolonia-simple-style-polygon', 'fill-color', ['"value"', '#00ff00', 'rgb(0, 0, 255)']],
|
|
24
|
+
['#heatmap', 'geolonia-simple-style-heatmap', 'heatmap-weight', ['"weight"']],
|
|
25
|
+
['#heatmap', 'geolonia-simple-style-heatmap', 'heatmap-color', ['#00ff00', '#0000ff']],
|
|
26
|
+
['#circle', 'geolonia-simple-style-circle-points', 'circle-radius', ['"weight"']],
|
|
27
|
+
['#circle', 'geolonia-simple-style-circle-points', 'circle-color', ['"category"', '#00ff00', '#0000ff']],
|
|
28
|
+
] as const) {
|
|
29
|
+
test(`${selector} の ${property} に属性の指定が届く`, async ({ page }) => {
|
|
30
|
+
await waitForStyleLoad(page, selector);
|
|
31
|
+
expect(await hasLayer(page, layer, selector)).toBe(true);
|
|
32
|
+
|
|
33
|
+
// 届いていなければ paint の中身を返して、失敗時に何が入っていたかを見えるようにする
|
|
34
|
+
await expect
|
|
35
|
+
.poll(
|
|
36
|
+
async () => {
|
|
37
|
+
const paint = JSON.stringify(
|
|
38
|
+
await page.evaluate(
|
|
39
|
+
({ sel, layer, property }) => {
|
|
40
|
+
const el = document.querySelector(sel) as any;
|
|
41
|
+
return el.geoloniaMap.getPaintProperty(layer, property);
|
|
42
|
+
},
|
|
43
|
+
{ sel: selector, layer, property },
|
|
44
|
+
),
|
|
45
|
+
);
|
|
46
|
+
return expected.every((s) => paint.includes(s)) ? 'ok' : paint;
|
|
47
|
+
},
|
|
48
|
+
{ timeout: 5000 },
|
|
49
|
+
)
|
|
50
|
+
.toBe('ok');
|
|
51
|
+
|
|
52
|
+
// 不正な式は MapLibre が拒否して error イベントで報告する
|
|
53
|
+
const mapErrors = await page.evaluate(
|
|
54
|
+
(id) => (window as any).__mapErrors[id],
|
|
55
|
+
selector.slice(1),
|
|
56
|
+
);
|
|
57
|
+
expect(mapErrors).toEqual([]);
|
|
58
|
+
expect(pageErrors).toEqual([]);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geolonia/embed",
|
|
3
|
-
"version": "6.0.0-pre.
|
|
3
|
+
"version": "6.0.0-pre.6",
|
|
4
4
|
"description": "Geolonia embed JS API",
|
|
5
5
|
"main": "dist/embed.js",
|
|
6
6
|
"types": "dist/src/embed.d.ts",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"webpack-dev-server": "^6.0.0"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@geolonia/maps-core": "^0.
|
|
61
|
+
"@geolonia/maps-core": "^0.8.0",
|
|
62
62
|
"@playwright/test": "^1.61.1",
|
|
63
63
|
"maplibre-gl": "6.12.0"
|
|
64
64
|
},
|
|
@@ -171,6 +171,152 @@ describe('attsToOptions', () => {
|
|
|
171
171
|
});
|
|
172
172
|
});
|
|
173
173
|
|
|
174
|
+
// data-choropleth / data-heatmap / data-circle-* (embed#546 / maps-core#156)。
|
|
175
|
+
describe('attsToOptions のデータ駆動の描き方', () => {
|
|
176
|
+
beforeEach(() => {
|
|
177
|
+
keyring.reset();
|
|
178
|
+
keyring.setApiKey('YOUR-API-KEY');
|
|
179
|
+
keyring.setStage('v1');
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
afterEach(() => {
|
|
183
|
+
keyring.reset();
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
const toOptions = (dataset: Record<string, string>) => {
|
|
187
|
+
const container = document.createElement('div');
|
|
188
|
+
Object.assign(container.dataset, dataset);
|
|
189
|
+
return attsToOptions(container, parseAtts(container));
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
it('属性が無ければ choropleth / heatmap / circle を渡さない', () => {
|
|
193
|
+
const options = toOptions({});
|
|
194
|
+
|
|
195
|
+
expect(options.choropleth).toBe(undefined);
|
|
196
|
+
expect(options.heatmap).toBe(undefined);
|
|
197
|
+
expect(options.circle).toBe(undefined);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
it('data-choropleth はプロパティ名だけを渡す', () => {
|
|
201
|
+
expect(toOptions({ choropleth: 'value' }).choropleth).toEqual({
|
|
202
|
+
property: 'value',
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it('data-choropleth-colors と data-choropleth-range を読む', () => {
|
|
207
|
+
const options = toOptions({
|
|
208
|
+
choropleth: 'value',
|
|
209
|
+
choroplethColors: '#ffffff, #ff0000',
|
|
210
|
+
choroplethRange: '0, 100',
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
expect(options.choropleth).toEqual({
|
|
214
|
+
property: 'value',
|
|
215
|
+
colors: ['#ffffff', '#ff0000'],
|
|
216
|
+
range: [0, 100],
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
it('色の区切りは括弧の中のカンマを区切りとして扱わない', () => {
|
|
221
|
+
const options = toOptions({
|
|
222
|
+
choropleth: 'value',
|
|
223
|
+
choroplethColors:
|
|
224
|
+
'rgb(255, 255, 255),rgba(255, 0, 0, 0.5) , hsl(0, 100%, 50%)',
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
expect(options.choropleth).toEqual({
|
|
228
|
+
property: 'value',
|
|
229
|
+
colors: [
|
|
230
|
+
'rgb(255, 255, 255)',
|
|
231
|
+
'rgba(255, 0, 0, 0.5)',
|
|
232
|
+
'hsl(0, 100%, 50%)',
|
|
233
|
+
],
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
it('読めない data-choropleth-range は無視する', () => {
|
|
238
|
+
for (const range of ['abc', '1', '1,2,3', '1,x', '', '100,0', '5,5']) {
|
|
239
|
+
expect(
|
|
240
|
+
toOptions({ choropleth: 'value', choroplethRange: range }).choropleth,
|
|
241
|
+
).toEqual({ property: 'value' });
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it('data-choropleth が無ければ -colors と -range は無視する', () => {
|
|
246
|
+
const options = toOptions({
|
|
247
|
+
choroplethColors: '#fff,#f00',
|
|
248
|
+
choroplethRange: '0,1',
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
expect(options.choropleth).toBe(undefined);
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
it('data-heatmap="on" は重みなしのヒートマップにする', () => {
|
|
255
|
+
expect(toOptions({ heatmap: 'on' }).heatmap).toEqual({});
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it('data-heatmap="off" と空の値はヒートマップにしない', () => {
|
|
259
|
+
expect(toOptions({ heatmap: 'off' }).heatmap).toBe(undefined);
|
|
260
|
+
expect(toOptions({ heatmap: '' }).heatmap).toBe(undefined);
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
it('data-heatmap の on / off は大文字小文字と前後の空白を区別しない', () => {
|
|
264
|
+
expect(toOptions({ heatmap: 'ON' }).heatmap).toEqual({});
|
|
265
|
+
expect(toOptions({ heatmap: ' On ' }).heatmap).toEqual({});
|
|
266
|
+
expect(toOptions({ heatmap: 'OFF' }).heatmap).toBe(undefined);
|
|
267
|
+
expect(toOptions({ heatmap: 'Off' }).heatmap).toBe(undefined);
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
it('data-heatmap のプロパティ名は大文字小文字をそのまま渡す', () => {
|
|
271
|
+
expect(toOptions({ heatmap: 'Weight' }).heatmap).toEqual({
|
|
272
|
+
weight: 'Weight',
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
it('data-heatmap が無ければ data-heatmap-colors は無視する', () => {
|
|
277
|
+
expect(toOptions({ heatmapColors: '#ff0,#f00' }).heatmap).toBe(undefined);
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
it('data-heatmap にプロパティ名を書くとその値を重みにする', () => {
|
|
281
|
+
expect(toOptions({ heatmap: 'weight' }).heatmap).toEqual({
|
|
282
|
+
weight: 'weight',
|
|
283
|
+
});
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
it('data-heatmap-colors を読む', () => {
|
|
287
|
+
expect(
|
|
288
|
+
toOptions({ heatmap: 'on', heatmapColors: '#ff0,#f00' }).heatmap,
|
|
289
|
+
).toEqual({ colors: ['#ff0', '#f00'] });
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
it('data-circle-size と data-circle-color と data-circle-colors を読む', () => {
|
|
293
|
+
const options = toOptions({
|
|
294
|
+
circleSize: 'weight',
|
|
295
|
+
circleColor: 'category',
|
|
296
|
+
circleColors: '#f00,#0f0,#00f',
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
expect(options.circle).toEqual({
|
|
300
|
+
size: 'weight',
|
|
301
|
+
color: 'category',
|
|
302
|
+
colors: ['#f00', '#0f0', '#00f'],
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
it('data-circle-size か data-circle-color の片方だけでも円にする', () => {
|
|
307
|
+
expect(toOptions({ circleSize: 'weight' }).circle).toEqual({
|
|
308
|
+
size: 'weight',
|
|
309
|
+
});
|
|
310
|
+
expect(toOptions({ circleColor: 'category' }).circle).toEqual({
|
|
311
|
+
color: 'category',
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
it('data-circle-colors だけでは円にしない', () => {
|
|
316
|
+
expect(toOptions({ circleColors: '#f00' }).circle).toBe(undefined);
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
|
|
174
320
|
// data-lang の言語解決 (embed#462 / maps-core#50)。
|
|
175
321
|
// 正しい契約 (maps-core#50 のテストが基準):
|
|
176
322
|
// - `ja` / `ja-jp` のみ日本語スタイル、それ以外は英語スタイル
|
package/src/lib/parse-atts.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
import type { ControlPosition } from 'maplibre-gl';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
getLang,
|
|
6
|
+
keyring,
|
|
7
|
+
type ChoroplethOptions,
|
|
8
|
+
type CircleOptions,
|
|
9
|
+
type GeoloniaMapOptions,
|
|
10
|
+
type HeatmapOptions,
|
|
11
|
+
} from '@geolonia/maps-core';
|
|
5
12
|
import type { EmbedAttributes } from '../types';
|
|
6
13
|
|
|
7
14
|
type ParseAttsParams = {
|
|
@@ -125,6 +132,99 @@ const resolveGeojson = (
|
|
|
125
132
|
return value;
|
|
126
133
|
};
|
|
127
134
|
|
|
135
|
+
/**
|
|
136
|
+
* Split a comma-separated list of CSS colors. Commas inside parentheses
|
|
137
|
+
* (`rgb(0, 0, 0)`) are part of the color, not separators.
|
|
138
|
+
*/
|
|
139
|
+
const parseColors = (value: string): string[] => {
|
|
140
|
+
const colors: string[] = [];
|
|
141
|
+
let depth = 0;
|
|
142
|
+
let current = '';
|
|
143
|
+
for (const char of value) {
|
|
144
|
+
if (char === '(') depth++;
|
|
145
|
+
if (char === ')') depth = Math.max(0, depth - 1);
|
|
146
|
+
if (char === ',' && depth === 0) {
|
|
147
|
+
colors.push(current);
|
|
148
|
+
current = '';
|
|
149
|
+
} else {
|
|
150
|
+
current += char;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
colors.push(current);
|
|
154
|
+
return colors.map((c) => c.trim()).filter((c) => c !== '');
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Parse `"min,max"` into a range, or `undefined` when it is not two numbers
|
|
159
|
+
* with min < max (a reversed range would paint everything in one color).
|
|
160
|
+
*/
|
|
161
|
+
const parseRange = (value: string): [number, number] | undefined => {
|
|
162
|
+
const parts = value.split(',').map((n) => n.trim());
|
|
163
|
+
if (parts.length !== 2 || parts.some((n) => n === '')) {
|
|
164
|
+
return undefined;
|
|
165
|
+
}
|
|
166
|
+
const [min, max] = parts.map(Number);
|
|
167
|
+
if (!Number.isFinite(min) || !Number.isFinite(max) || min >= max) {
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
return [min, max];
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Convert `data-choropleth` / `data-heatmap` / `data-circle-*` into maps-core's
|
|
175
|
+
* data-driven options. The `-colors` / `-range` attributes only apply when the
|
|
176
|
+
* attribute that turns the drawing on is present.
|
|
177
|
+
*/
|
|
178
|
+
const dataDrivenOptions = (
|
|
179
|
+
atts: EmbedAttributes,
|
|
180
|
+
): Pick<GeoloniaMapOptions, 'choropleth' | 'heatmap' | 'circle'> => {
|
|
181
|
+
const options: Pick<GeoloniaMapOptions, 'choropleth' | 'heatmap' | 'circle'> =
|
|
182
|
+
{};
|
|
183
|
+
|
|
184
|
+
if (atts.choropleth) {
|
|
185
|
+
const choropleth: ChoroplethOptions = { property: String(atts.choropleth) };
|
|
186
|
+
if (atts.choroplethColors) {
|
|
187
|
+
choropleth.colors = parseColors(String(atts.choroplethColors));
|
|
188
|
+
}
|
|
189
|
+
const range = atts.choroplethRange
|
|
190
|
+
? parseRange(String(atts.choroplethRange))
|
|
191
|
+
: undefined;
|
|
192
|
+
if (range) {
|
|
193
|
+
choropleth.range = range;
|
|
194
|
+
}
|
|
195
|
+
options.choropleth = choropleth;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const heatmapValue = String(atts.heatmap ?? '').trim();
|
|
199
|
+
const heatmapFlag = heatmapValue.toLowerCase();
|
|
200
|
+
if (heatmapValue && heatmapFlag !== 'off') {
|
|
201
|
+
const heatmap: HeatmapOptions = {};
|
|
202
|
+
if (heatmapFlag !== 'on') {
|
|
203
|
+
heatmap.weight = heatmapValue;
|
|
204
|
+
}
|
|
205
|
+
if (atts.heatmapColors) {
|
|
206
|
+
heatmap.colors = parseColors(String(atts.heatmapColors));
|
|
207
|
+
}
|
|
208
|
+
options.heatmap = heatmap;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if (atts.circleSize || atts.circleColor) {
|
|
212
|
+
const circle: CircleOptions = {};
|
|
213
|
+
if (atts.circleSize) {
|
|
214
|
+
circle.size = String(atts.circleSize);
|
|
215
|
+
}
|
|
216
|
+
if (atts.circleColor) {
|
|
217
|
+
circle.color = String(atts.circleColor);
|
|
218
|
+
}
|
|
219
|
+
if (atts.circleColors) {
|
|
220
|
+
circle.colors = parseColors(String(atts.circleColors));
|
|
221
|
+
}
|
|
222
|
+
options.circle = circle;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return options;
|
|
226
|
+
};
|
|
227
|
+
|
|
128
228
|
/**
|
|
129
229
|
* Convert normalised {@link EmbedAttributes} into a typed `GeoloniaMapOptions`
|
|
130
230
|
* for maps-core's `GeoloniaMap` constructor.
|
|
@@ -195,6 +295,7 @@ export const attsToOptions = (
|
|
|
195
295
|
if (atts.simpleVector) {
|
|
196
296
|
options.simpleVector = String(atts.simpleVector);
|
|
197
297
|
}
|
|
298
|
+
Object.assign(options, dataDrivenOptions(atts));
|
|
198
299
|
|
|
199
300
|
if (
|
|
200
301
|
atts.minZoom !== '' &&
|
package/src/types.ts
CHANGED
|
@@ -171,6 +171,40 @@ export type EmbedAttributes = {
|
|
|
171
171
|
* @defaultValue `''`(off として扱われる)
|
|
172
172
|
*/
|
|
173
173
|
'3d': string;
|
|
174
|
+
/**
|
|
175
|
+
* `data-choropleth`:`data-geojson` のポリゴンを、このプロパティの値で塗り分ける。
|
|
176
|
+
* 既定値はなく、指定したときだけキーが入る。
|
|
177
|
+
*/
|
|
178
|
+
choropleth?: string;
|
|
179
|
+
/**
|
|
180
|
+
* `data-choropleth-colors`:塗り分けの色。値の小さい側から順にカンマで区切る。
|
|
181
|
+
* `data-choropleth` が無いときは無視する。
|
|
182
|
+
*/
|
|
183
|
+
choroplethColors?: string;
|
|
184
|
+
/**
|
|
185
|
+
* `data-choropleth-range`:色を割り当てる値の範囲。`"最小,最大"` 形式。
|
|
186
|
+
* 省略時や読めないときはデータの最小値と最大値を使う。
|
|
187
|
+
*/
|
|
188
|
+
choroplethRange?: string;
|
|
189
|
+
/**
|
|
190
|
+
* `data-heatmap`:`data-geojson` のポイントをヒートマップで描く。`'on'` で重みなし、
|
|
191
|
+
* プロパティ名でその値を重みにする。`'off'` または空なら描かない。
|
|
192
|
+
*/
|
|
193
|
+
heatmap?: string;
|
|
194
|
+
/**
|
|
195
|
+
* `data-heatmap-colors`:ヒートマップの色。密度の低い側から順にカンマで区切る。
|
|
196
|
+
* `data-heatmap` が無いときは無視する。
|
|
197
|
+
*/
|
|
198
|
+
heatmapColors?: string;
|
|
199
|
+
/** `data-circle-size`:ポイントの円の大きさに使うプロパティ名。 */
|
|
200
|
+
circleSize?: string;
|
|
201
|
+
/** `data-circle-color`:ポイントの円の色に使うプロパティ名。 */
|
|
202
|
+
circleColor?: string;
|
|
203
|
+
/**
|
|
204
|
+
* `data-circle-colors`:`data-circle-color` に使う色をカンマで区切る。
|
|
205
|
+
* `data-circle-size` と `data-circle-color` のどちらも無いときは無視する。
|
|
206
|
+
*/
|
|
207
|
+
circleColors?: string;
|
|
174
208
|
/**
|
|
175
209
|
* 追加の `data-*` 属性はそのまま透過される({@link EmbedPlugin} が利用する
|
|
176
210
|
* プラグイン固有の属性など)。
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '6.0.0-pre.
|
|
1
|
+
export const VERSION = '6.0.0-pre.6';
|