Skip to content

Commit

Permalink
Merge 5b5d914 into 66ae929
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed Mar 25, 2022
2 parents 66ae929 + 5b5d914 commit e79825e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
8 changes: 6 additions & 2 deletions packages/l7plot/src/core/plot/index.ts
Expand Up @@ -248,8 +248,12 @@ export abstract class Plot<O extends PlotOptions> extends Map<O> {
this.source.setData(this.options.source.data, sourceCFG);

// 更新 legend
if (this.options.legend) {
this.updateLegendControl(this.options.legend);
// TODO: 数据更新后,图层尚未执行更新,后续加图层 update 事件来解决
const legend = this.options.legend;
if (legend) {
setTimeout(() => {
this.updateLegendControl(legend);
});
}

this.emit('change-data');
Expand Down
8 changes: 6 additions & 2 deletions packages/l7plot/src/plots/choropleth/index.ts
Expand Up @@ -194,8 +194,12 @@ export class Choropleth extends Plot<ChoroplethOptions> {
console.timeEnd('l7plot choropleth update data time');

// 更新 legend
if (this.options.legend) {
this.updateLegendControl(this.options.legend);
// TODO: 数据更新后,图层尚未执行更新,后续加图层 update 事件来解决
const legend = this.options.legend;
if (legend) {
setTimeout(() => {
this.updateLegendControl(legend);
});
}

this.emit('change-data');
Expand Down
3 changes: 2 additions & 1 deletion storybook/stories/plots/choropleth/Drill.tsx
Expand Up @@ -60,8 +60,9 @@ class Drill extends Component {
},

color: {
field: 'name',
field: 'adcode',
value: ['#B8E1FF', '#7DAAFF', '#3D76DD', '#0047A5', '#001D70'],
scale: { type: 'quantize' },
},
style: {
opacity: 0.8,
Expand Down
2 changes: 1 addition & 1 deletion website/docs/api/plots/choropleth.zh.md
Expand Up @@ -264,7 +264,7 @@ plot.drillUp(config?: DrillStepConfig, level?: `'world'|'country'|'province'

### getCurrentDrillSteps

获取当前已钻取层级数据。
获取当前已钻取层级数据,配合开启[钻取功能](/zh/docs/api/plots/choropleth#`options.`drill)时使用

```js
plot.getCurrentDrillSteps(): ViewLevel[];
Expand Down

0 comments on commit e79825e

Please sign in to comment.