Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: remove theme:'classic'and padding: 'auto' #5490

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions site/docs/manual/core/animation.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ chart.interval().animate({

```js | ob
(() => {
const chart = new G2.Chart({ theme: 'classic', padding: 'auto' });
const chart = new G2.Chart();

chart
.interval()
Expand Down Expand Up @@ -90,7 +90,7 @@ chart.interval().animate({

```js | ob
(() => {
const chart = new G2.Chart({ theme: 'classic', padding: 'auto' });
const chart = new G2.Chart();

chart
.interval()
Expand Down Expand Up @@ -123,7 +123,7 @@ G2 也提供了 StackEnter 标记转换来实现分组动画,该标记转换

```js | ob
(() => {
const chart = new G2.Chart({ theme: 'classic', padding: 'auto' });
const chart = new G2.Chart();

chart
.interval()
Expand Down Expand Up @@ -159,7 +159,7 @@ G2 也提供了 StackEnter 标记转换来实现分组动画,该标记转换
'https://gw.alipayobjects.com/os/antvdemo/assets/data/scatter.json',
).then((res) => res.json());

const chart = new G2.Chart({ theme: 'classic', padding: 'auto' });
const chart = new G2.Chart();

// 参考 css animation 的描述
const keyframe = chart
Expand Down
13 changes: 5 additions & 8 deletions site/docs/manual/core/api.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ G2 设计了一套**规范(Spec)** 去描述可以绘制的可视化,使

```js | ob
(() => {
const chart = new G2.Chart({ theme: 'classic', padding: 'auto' });
const chart = new G2.Chart();

chart.options({
type: 'interval',
Expand Down Expand Up @@ -36,7 +36,7 @@ G2 设计了一套**规范(Spec)** 去描述可以绘制的可视化,使

```js | ob
(() => {
const chart = new G2.Chart({ theme: 'classic', padding: 'auto' });
const chart = new G2.Chart();

chart
.interval()
Expand Down Expand Up @@ -129,7 +129,7 @@ spaceFlex.interval();

```js | ob
(() => {
const chart = new G2.Chart({ theme: 'classic', padding: 'auto' });
const chart = new G2.Chart();

chart.options({
type: 'interval', // 标记节点
Expand Down Expand Up @@ -165,7 +165,7 @@ spaceFlex.interval();

```js | ob
(() => {
const chart = new G2.Chart({ theme: 'classic', padding: 'auto' });
const chart = new G2.Chart();

chart.options({
type: 'view', // 视图节点
Expand Down Expand Up @@ -213,15 +213,12 @@ spaceFlex.interval();

```js | ob
(() => {
const chart = new G2.Chart({
theme: 'classic',
});
const chart = new G2.Chart();

chart.options({
type: 'spaceFlex',
width: 800,
height: 400,
theme: 'classic',
children: [
{
type: 'interval',
Expand Down
10 changes: 3 additions & 7 deletions site/docs/manual/core/chart.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ G2 的大部分能力通过 `Chart` 对象暴露给用户,比如绘制一个

```js | ob
(() => {
const chart = new G2.Chart({ theme: 'classic', padding: 'auto' });
const chart = new G2.Chart();

chart
.interval()
Expand Down Expand Up @@ -43,15 +43,14 @@ const chart = new Chart({

## 全局选项

可以通 `new Chart(options)` 指定一些全局选项:比如挂载的容器,宽度,高度等。除了 **theme** 属性之外,其他这些选项都是**可选的**。
可以通 `new Chart(options)` 指定一些全局选项:比如挂载的容器,宽度,高度等。所有的选项都是**可选的**。

```js
// 按需指定选项
const chart = new Chart({
width: 800, // 图表高度
height: 400, // 图表宽度
container: 'chart', // 挂载容器的 ID
theme: 'classic',
});
```

Expand All @@ -68,20 +67,18 @@ const chart = new Chart({
```js
const chart = new Chart({
container: 'chart', // 指定挂载容器 id
theme: 'classic',
});

// 或者
const chart = new Chart({
container: document.getElementById('chart'), // 指定挂载容器
theme: 'classic',
});
```

第二种,手动挂载。

```js
const chart = new Chart({ theme: 'classic' });
const chart = new Chart();

// 声明可视化
// ...
Expand All @@ -98,7 +95,6 @@ document.getElementById('chart').appendChild(container);
// 创建图表实例
const chart = new Chart({
container: 'chart',
theme: 'classic',
});

// 声明可视化
Expand Down
8 changes: 3 additions & 5 deletions site/docs/manual/core/composition.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ layer.view();

```js | ob
(() => {
const chart = new G2.Chart({ padding: 'auto', theme: 'classic' });
const chart = new G2.Chart();

const layer = chart.spaceLayer();

Expand Down Expand Up @@ -74,7 +74,7 @@ layer.view();

```js | ob
(() => {
const chart = new G2.Chart({ theme: 'classic', width: 800, height: 400 });
const chart = new G2.Chart();
const flex = chart.spaceFlex();

// 条形图
Expand Down Expand Up @@ -121,7 +121,6 @@ layer.view();
```js | ob
(() => {
const chart = new G2.Chart({
theme: 'classic',
height: 260,
width: 800,
paddingLeft: 40,
Expand Down Expand Up @@ -159,7 +158,6 @@ layer.view();
```js | ob
(() => {
const chart = new G2.Chart({
theme: 'classic',
width: 900,
height: 900,
padding: 'auto',
Expand Down Expand Up @@ -202,7 +200,7 @@ layer.view();
'https://gw.alipayobjects.com/os/antvdemo/assets/data/scatter.json',
).then((res) => res.json());

const chart = new G2.Chart({ theme: 'classic', padding: 'auto' });
const chart = new G2.Chart();

// 参考 css animation 的描述
const keyframe = chart
Expand Down
14 changes: 7 additions & 7 deletions site/docs/manual/core/coordinate.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ chart.area():
};
}

const chart = new G2.Chart({ padding: 'auto', theme: 'classic' });
const chart = new G2.Chart();

chart.options({
type: Pie, // 使用该复合 Mark
Expand Down Expand Up @@ -112,7 +112,7 @@ chart.area():

```js | ob
(() => {
const chart = new G2.Chart({ padding: 'auto', theme: 'classic' });
const chart = new G2.Chart();

chart
.interval()
Expand Down Expand Up @@ -141,7 +141,7 @@ chart.area():

```js | ob
(() => {
const chart = new G2.Chart({ padding: 'auto', theme: 'classic' });
const chart = new G2.Chart();

chart
.interval()
Expand Down Expand Up @@ -169,7 +169,7 @@ chart.area():

```js | ob
(() => {
const chart = new G2.Chart({ padding: 'auto', theme: 'classic' });
const chart = new G2.Chart();

chart
.interval()
Expand Down Expand Up @@ -218,7 +218,7 @@ chart.area():
lineStrokeWidth: 1,
};

const chart = new G2.Chart({ padding: 'auto', theme: 'classic' });
const chart = new G2.Chart();

chart
.line()
Expand Down Expand Up @@ -275,7 +275,7 @@ chart.area():

```js | ob
(() => {
const chart = new G2.Chart({ padding: 'auto', theme: 'classic' });
const chart = new G2.Chart();

chart
.interval()
Expand All @@ -302,7 +302,7 @@ chart.area():

```js | ob
(() => {
const chart = new G2.Chart({ padding: 'auto', theme: 'classic' });
const chart = new G2.Chart();

chart
.point()
Expand Down
4 changes: 2 additions & 2 deletions site/docs/manual/core/data.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ chart.interval().data([

```js | ob
(() => {
const chart = new G2.Chart({ theme: 'classic', padding: 'auto' });
const chart = new G2.Chart();

chart
.rangeX()
Expand Down Expand Up @@ -139,7 +139,7 @@ chart.interval().data([

```js | ob
(() => {
const chart = new G2.Chart({ theme: 'classic', padding: 'auto' });
const chart = new G2.Chart();

chart.data([
{ year: '1991', value: 3 },
Expand Down
8 changes: 4 additions & 4 deletions site/docs/manual/core/encode.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ table({

```js | ob
(() => {
const chart = new G2.Chart({ theme: 'classic', padding: 'auto' });
const chart = new G2.Chart();

chart
.point()
Expand Down Expand Up @@ -178,7 +178,7 @@ table({
const X = I.map((i) => ((i - 2) * Math.PI) / 2);
const Y = X.map((x) => Math.sin(x));

const chart = new G2.Chart({ theme: 'classic', padding: 'auto' });
const chart = new G2.Chart();

chart
.line()
Expand All @@ -199,7 +199,7 @@ table({

```js
(() => {
const chart = new G2.Chart({ theme: 'classic', padding: 'auto' });
const chart = new G2.Chart();

chart
.interval()
Expand Down Expand Up @@ -258,7 +258,7 @@ chart.encode('y', 'end').encode('y1', 'start');

```js | ob
(() => {
const chart = new G2.Chart({ theme: 'classic', padding: 'auto' });
const chart = new G2.Chart();

chart
.data([
Expand Down
4 changes: 2 additions & 2 deletions site/docs/manual/core/interaction.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ chart.area():

```js | ob
(() => {
const chart = new G2.Chart({ padding: 'auto', theme: 'classic' });
const chart = new G2.Chart();

chart
.interval()
Expand Down Expand Up @@ -127,7 +127,7 @@ chart.area():

```js | ob
(() => {
const chart = new G2.Chart({ padding: 'auto', theme: 'classic' });
const chart = new G2.Chart();

chart
.interval()
Expand Down
8 changes: 4 additions & 4 deletions site/docs/manual/core/label.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ chart.labelTransform([{ type: 'overlapHide' }, { type: 'contrastReverse' }]);

```js | ob
(() => {
const chart = new G2.Chart({ padding: 'auto', theme: 'classic' });
const chart = new G2.Chart();

chart
.interval()
Expand Down Expand Up @@ -139,7 +139,7 @@ chart.labelTransform([{ type: 'overlapHide' }, { type: 'contrastReverse' }]);

```js | ob
(() => {
const chart = new G2.Chart({ padding: 'auto', theme: 'classic' });
const chart = new G2.Chart();

chart
.line()
Expand Down Expand Up @@ -173,7 +173,7 @@ chart.labelTransform([{ type: 'overlapHide' }, { type: 'contrastReverse' }]);

```js | ob
(() => {
const chart = new G2.Chart({ padding: 'auto', theme: 'classic' });
const chart = new G2.Chart();

chart
.line()
Expand Down Expand Up @@ -202,7 +202,7 @@ chart.labelTransform([{ type: 'overlapHide' }, { type: 'contrastReverse' }]);

```js | ob
(() => {
const chart = new G2.Chart({ padding: 'auto', theme: 'classic' });
const chart = new G2.Chart();

chart
.line()
Expand Down
Loading
Loading