Skip to content

Commit

Permalink
fix(docs): 修复文档 demo 无限增大 (#2625)
Browse files Browse the repository at this point in the history
close: #2623
  • Loading branch information
visiky authored Jun 10, 2021
1 parent c3a47a2 commit fa1c250
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 19 deletions.
3 changes: 2 additions & 1 deletion docs/common/crosshairs-text.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ type TooltipCrosshairsTextCallback = (
) => TooltipCrosshairsText;
```

<playground path="more-plots/stock/demo/custom-crosshairs.ts" rid="crosshairs"></playground>
<!-- 容器无限变大 -->
<!-- <playground path="more-plots/stock/demo/custom-crosshairs.ts" rid="crosshairs" height=400></playground> -->
3 changes: 2 additions & 1 deletion docs/common/crosshairs-text.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ type TooltipCrosshairsText = {
type TooltipCrosshairsTextCallback = (type: string, defaultContent: any, items: any[], currentPoint: Point) => TooltipCrosshairsText;
```

<playground path="more-plots/stock/demo/custom-crosshairs.ts" rid="crosshairs"></playground>
<!-- 容器无限变大 -->
<!-- <playground path="more-plots/stock/demo/custom-crosshairs.ts" rid="crosshairs" height="400"></playground> -->
2 changes: 1 addition & 1 deletion examples/more-plots/stock/demo/slider.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Stock } from '@antv/g2plot';

fetch('https://gw.alipayobjects.com/os/antfincdn/qtQ9nYfYJe/stock-data.json')
fetch('https://gw.alipayobjects.com/os/antfincdn/ZWgtj7pC%261/stock.json')
.then((data) => data.json())
.then((data) => {
const stockPlot = new Stock('container', {
Expand Down
18 changes: 2 additions & 16 deletions examples/more-plots/treemap/demo/drill-down.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
import { Treemap } from '@antv/g2plot';
import { each, clone } from '@antv/util';

fetch('https://gw.alipayobjects.com/os/basement_prod/c2589761-62d6-411d-9d51-794d6860c4a9.json')
fetch('https://gw.alipayobjects.com/os/antfincdn/k5SYI%24mOo1/treemap.json')
.then((res) => res.json())
.then((fetchData) => {
const rootData = { name: '公司销售数据', children: [] };
each(fetchData, (s) => {
const children = clone(s.children);
const childrenArray = [];
each(children, (c) => {
if (c.children && c.children.length > 0) {
childrenArray.push(c);
}
});
s.children = childrenArray;
rootData.children.push(s);
});

.then((rootData) => {
const treemapPlot = new Treemap('container', {
data: rootData,
colorField: 'name',
Expand Down

0 comments on commit fa1c250

Please sign in to comment.