Skip to content

Commit

Permalink
docs: optimize examples style for doc (#3306)
Browse files Browse the repository at this point in the history
  • Loading branch information
NewByVector authored Feb 27, 2023
1 parent 8fc0b72 commit 6317493
Show file tree
Hide file tree
Showing 16 changed files with 135 additions and 140 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"prettier --write --ignore-unknown"
],
"*.less": [
"stylelint --syntax less --fix"
"stylelint --customSyntax postcss-less --fix"
],
"*.js": [
"prettier --write"
Expand Down
4 changes: 2 additions & 2 deletions sites/x6-sites/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"@antv/x6-plugin-transform": "^2.x",
"@antv/x6-react-components": "^2.x",
"@antv/x6-react-shape": "^2.x",
"antd": "^4.4.2",
"antd": "^5.0.0",
"dagre": "^0.8.5",
"dumi": "2.0.16",
"dumi": "^2.1.14",
"elkjs": "^0.8.2",
"highlight.js": "^10.1.2",
"react": "^18.0.0",
Expand Down
37 changes: 17 additions & 20 deletions sites/x6-sites/src/tutorial/basic/graph/auto-resize/index.less
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
.app {
.auto-resize-app {
display: flex;
width: 600px;
height: 400px;
padding: 0;
padding: 16px 8px;
font-family: sans-serif;
}

.app-content {
flex: 1;
height: 280px;
margin-right: 8px;
margin-left: 8px;
border-radius: 5px;
box-shadow: 0 12px 5px -10px rgb(0 0 0 / 10%), 0 0 4px 0 rgb(0 0 0 / 10%);
}
.app-content {
flex: 1;
height: 280px;
margin-right: 8px;
margin-left: 8px;
border-radius: 5px;
box-shadow: 0 12px 5px -10px rgb(0 0 0 / 10%), 0 0 4px 0 rgb(0 0 0 / 10%);
}

.full {
width: 100%;
height: 100%;
.full {
width: 100%;
height: 100%;
}
}

:global {
.x6-split-box-horizontal > .x6-split-box-resizer,
.x6-split-box-vertical > .x6-split-box-resizer {
background: #e3e6e9;
}
}
.x6-split-box-horizontal > .x6-split-box-resizer,
.x6-split-box-vertical > .x6-split-box-resizer {
background: #e3e6e9;
}
10 changes: 5 additions & 5 deletions sites/x6-sites/src/tutorial/basic/graph/auto-resize/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react'
import { Graph } from '@antv/x6'
import { SplitBox } from '@antv/x6-react-components'
import '@antv/x6-react-components/es/split-box/style/index.css'
import styles from './index.less'
import './index.less'

export default class Example extends React.Component {
private container1: HTMLDivElement
Expand Down Expand Up @@ -50,16 +50,16 @@ export default class Example extends React.Component {

render() {
return (
<div className={styles.app}>
<div className="auto-resize-app">
<SplitBox split="horizontal">
<div className={styles.full}>
<div className="full">
<div ref={this.refContainer1} />
</div>
<SplitBox split="vertical">
<div className={styles.full}>
<div className="full">
<div ref={this.refContainer2} />
</div>
<div className={styles.full}>
<div className="full">
<div ref={this.refContainer3} />
</div>
</SplitBox>
Expand Down
20 changes: 10 additions & 10 deletions sites/x6-sites/src/tutorial/basic/graph/background-grid/index.less
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
.app {
.backgournd-grid-app {
display: flex;
width: 100%;
padding: 0;
padding: 16px 8px;
font-family: sans-serif;
}

.app-content {
flex: 1;
height: 280px;
margin-right: 8px;
margin-left: 8px;
border-radius: 5px;
box-shadow: 0 12px 5px -10px rgb(0 0 0 / 10%), 0 0 4px 0 rgb(0 0 0 / 10%);
.app-content {
flex: 1;
height: 280px;
margin-right: 8px;
margin-left: 8px;
border-radius: 5px;
box-shadow: 0 12px 5px -10px rgb(0 0 0 / 10%), 0 0 4px 0 rgb(0 0 0 / 10%);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { Graph } from '@antv/x6'
import styles from './index.less'
import './index.less'

const data = {
nodes: [
Expand Down Expand Up @@ -93,8 +93,8 @@ export default class Example extends React.Component {

render() {
return (
<div className={styles.app}>
<div className={styles['app-content']} ref={this.refContainer} />
<div className="backgournd-grid-app">
<div className="app-content" ref={this.refContainer} />
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
.app {
.panning-mousewheel-app {
display: flex;
width: 100%;
padding: 0;
padding: 16px 8px;
font-family: sans-serif;
}

.app-content {
flex: 1;
height: 280px;
margin-right: 8px;
margin-left: 8px;
border-radius: 5px;
box-shadow: 0 12px 5px -10px rgb(0 0 0 / 10%), 0 0 4px 0 rgb(0 0 0 / 10%);
.app-content {
flex: 1;
height: 280px;
margin-right: 8px;
margin-left: 8px;
border-radius: 5px;
box-shadow: 0 12px 5px -10px rgb(0 0 0 / 10%), 0 0 4px 0 rgb(0 0 0 / 10%);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { Graph } from '@antv/x6'
import styles from './index.less'
import './index.less'

const data = {
nodes: [
Expand Down Expand Up @@ -98,8 +98,8 @@ export default class Example extends React.Component {

render() {
return (
<div className={styles.app}>
<div className={styles['app-content']} ref={this.refContainer} />
<div className="panning-mousewheel-app">
<div className="app-content" ref={this.refContainer} />
</div>
)
}
Expand Down
31 changes: 15 additions & 16 deletions sites/x6-sites/src/tutorial/basic/graph/transform/index.less
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
.app {
display: flex;
flex-direction: column;
.transform-app {
width: 100%;
padding: 0;
padding: 16px 8px;
font-family: sans-serif;
}

.app-btns {
bottom: 0;
padding: 0 8px;
}
.app-btns {
bottom: 0;
padding: 0 8px;
}

.app-content {
height: 240px;
margin-top: 16px;
margin-right: 8px;
margin-left: 8px;
border-radius: 5px;
box-shadow: 0 12px 5px -10px rgb(0 0 0 / 10%), 0 0 4px 0 rgb(0 0 0 / 10%);
.app-content {
width: 100%;
height: 240px;
margin-top: 16px;
margin-right: 8px;
margin-left: 8px;
border-radius: 5px;
box-shadow: 0 12px 5px -10px rgb(0 0 0 / 10%), 0 0 4px 0 rgb(0 0 0 / 10%);
}
}
9 changes: 4 additions & 5 deletions sites/x6-sites/src/tutorial/basic/graph/transform/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react'
import { Graph } from '@antv/x6'
import { Button } from 'antd'

import styles from './index.less'
import './index.less'

const data = {
nodes: [
Expand Down Expand Up @@ -150,8 +149,8 @@ export default class Example extends React.Component {

render() {
return (
<div className={styles.app}>
<div className={styles['app-btns']}>
<div className="transform-app">
<div className="app-btns">
<Button.Group>
{commands.map((item) => (
<Button onClick={() => this.transform(item.key)} key={item.key}>
Expand All @@ -160,7 +159,7 @@ export default class Example extends React.Component {
))}
</Button.Group>
</div>
<div className={styles['app-content']} ref={this.refContainer} />
<div className="app-content" ref={this.refContainer} />
</div>
)
}
Expand Down
21 changes: 11 additions & 10 deletions sites/x6-sites/src/tutorial/getting-started/helloworld/index.less
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
.app {
.helloworld-app {
display: flex;
width: 100%;
padding: 0;
font-family: sans-serif;
}

.app-content {
flex: 1;
height: 280px;
margin-right: 8px;
margin-left: 8px;
border-radius: 5px;
box-shadow: 0 12px 5px -10px rgb(0 0 0 / 10%), 0 0 4px 0 rgb(0 0 0 / 10%);
}
.app-content {
flex: 1;
height: 280px;
margin-right: 8px;
margin-left: 8px;
border-radius: 5px;
box-shadow: 0 12px 5px -10px rgb(0 0 0 / 10%), 0 0 4px 0 rgb(0 0 0 / 10%);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { Graph } from '@antv/x6'
import styles from './index.less'
import './index.less'

const data = {
nodes: [
Expand Down Expand Up @@ -81,8 +81,8 @@ export default class Example extends React.Component {

render() {
return (
<div className={styles.app}>
<div className={styles['app-content']} ref={this.refContainer} />
<div className="helloworld-app">
<div className="app-content" ref={this.refContainer} />
</div>
)
}
Expand Down
48 changes: 24 additions & 24 deletions sites/x6-sites/src/tutorial/getting-started/react-shape/index.less
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
.app {
.react-shape-app {
display: flex;
width: 100%;
padding: 0;
padding: 16px 8px;
font-family: sans-serif;
}

.app-content {
flex: 1;
height: 280px;
margin-right: 8px;
margin-left: 8px;
border-radius: 5px;
box-shadow: 0 12px 5px -10px rgb(0 0 0 / 10%), 0 0 4px 0 rgb(0 0 0 / 10%);
}
.app-content {
flex: 1;
height: 280px;
margin-right: 8px;
margin-left: 8px;
border-radius: 5px;
box-shadow: 0 12px 5px -10px rgb(0 0 0 / 10%), 0 0 4px 0 rgb(0 0 0 / 10%);
}

.custom-react-node {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
border: 1px solid #8f8f8f;
border-radius: 6px;
}
.custom-react-node {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
border: 1px solid #8f8f8f;
border-radius: 6px;
}

.custom-react-node span {
display: inline-block;
width: 100%;
height: 100%;
.custom-react-node span {
display: inline-block;
width: 100%;
height: 100%;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { Graph, Node } from '@antv/x6'
import { register } from '@antv/x6-react-shape'
import { Dropdown } from 'antd'
import styles from './index.less'
import './index.less'

const CustomComponent = ({ node }: { node: Node }) => {
const label = node.prop('label')
Expand All @@ -26,7 +26,7 @@ const CustomComponent = ({ node }: { node: Node }) => {
}}
trigger={['contextMenu']}
>
<div className={styles['custom-react-node']}>{label}</div>
<div className="custom-react-node">{label}</div>
</Dropdown>
)
}
Expand Down Expand Up @@ -92,8 +92,8 @@ export default class Example extends React.Component {

render() {
return (
<div className={styles.app}>
<div className={styles['app-content']} ref={this.refContainer} />
<div className="react-shape-app">
<div className="app-content" ref={this.refContainer} />
</div>
)
}
Expand Down
Loading

0 comments on commit 6317493

Please sign in to comment.