-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c084c01
commit ad6833a
Showing
4 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"title": { | ||
"zh": "💡 灵光乍现", | ||
"en": "Art Work" | ||
}, | ||
"demos": [ | ||
{ | ||
"filename": "mosaic.tsx", | ||
"title": { | ||
"zh": "马赛克", | ||
"en": "Mosaic" | ||
}, | ||
"screenshot": "https://gw.alipayobjects.com/zos/antfincdn/CT6lTXeKB6/20690319-81f8-4847-9247-c1f7e7f2d9d1.png" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { SheetComponent } from '@antv/s2-react'; | ||
import '@antv/s2-react/dist/style.min.css'; | ||
|
||
// Respect to Fuck Design (https://github.com/fuck-design/fuck-design) | ||
// more Info https://observablehq.com/@pearmini/draw-fuck-design-logo-with-antv-s2 | ||
|
||
fetch( | ||
'https://gw.alipayobjects.com/os/bmw-prod/7f6ebbb4-ffeb-4f6c-a763-6faa8c0ccf7a.json', | ||
) | ||
.then((res) => res.json()) | ||
.then((dataCfg) => { | ||
const s2Options = { | ||
width: 700, | ||
height: 575, | ||
frozenRowHeader: false, | ||
conditions: { | ||
background: [ | ||
{ | ||
field: "color", | ||
mapping: (fill) => ({ fill }) | ||
} | ||
] | ||
}, | ||
interaction: { | ||
hoverHighlight: false, | ||
hoverFocus: false | ||
}, | ||
style: { | ||
layoutWidthType: "compact", | ||
colCfg: { | ||
height: 0, | ||
widthByFieldValue: { | ||
color: 23 | ||
} | ||
}, | ||
cellCfg: { | ||
height: 23 | ||
} | ||
} | ||
}; | ||
|
||
const customTheme = { | ||
rowCell: { | ||
cell: { | ||
backgroundColor: dataCfg.data[0].color, | ||
horizontalBorderColorOpacity: 0, | ||
verticalBorderColorOpacity: 0 | ||
} | ||
}, | ||
dataCell: { | ||
text: { | ||
opacity: 0 | ||
}, | ||
cell: { | ||
horizontalBorderColorOpacity: 0, | ||
verticalBorderColorOpacity: 0 | ||
} | ||
}, | ||
splitLine: { | ||
horizontalBorderColorOpacity: 0, | ||
verticalBorderColorOpacity: 0 | ||
}, | ||
background: { | ||
color: dataCfg.data[0].color, | ||
}, | ||
scrollBar: { | ||
size: 0 | ||
} | ||
}; | ||
|
||
ReactDOM.render( | ||
<SheetComponent dataCfg={dataCfg} options={s2Options} themeCfg={{ theme: customTheme }} />, | ||
document.getElementById('container'), | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Art Work | ||
order: 6 | ||
--- | ||
`markdown:examples/case/art/index.zh.md` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: 💡灵光乍现 | ||
order: 6 | ||
--- | ||
|