-
Notifications
You must be signed in to change notification settings - Fork 81
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
1e063ec
commit 70cc98d
Showing
66 changed files
with
21,558 additions
and
15,250 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,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.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,11 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": ["@changesets/changelog-github", { "repo": "sakitam-fdd/ol3Echarts" }], | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "public", | ||
"baseBranch": "master", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
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,6 @@ | ||
--- | ||
'ol3-echarts': patch | ||
'ol-echarts': patch | ||
--- | ||
|
||
update build flow |
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
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,35 @@ | ||
name: Publish Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
paths: | ||
- 'packages/**' | ||
- 'docs/**' | ||
|
||
jobs: | ||
docs: | ||
timeout-minutes: 10 | ||
# env: | ||
# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
# TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: ./.github/setup | ||
|
||
- run: pnpm build | ||
- run: pnpm run api | ||
- run: pnpm docs:build | ||
|
||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.PKG_DEPLOY_TOKEN }} | ||
publish_dir: docs/build | ||
cname: blog.sakitam.com |
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
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
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
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 |
---|---|---|
|
@@ -43,3 +43,4 @@ coverage | |
/docs/api/ | ||
/docs/docs/typedoc/ | ||
/docs/.docusaurus/ | ||
/docs/build/ |
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 |
---|---|---|
@@ -1 +1 @@ | ||
v18.16.1 | ||
v20.18.0 |
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 |
---|---|---|
|
@@ -9,22 +9,23 @@ description: 了解如何安装 | |
## npm安装 | ||
|
||
```bash | ||
// old openlayers package | ||
# old openlayers package | ||
npm install ol3-echarts --save | ||
import ol3Echarts from 'ol3-echarts' | ||
|
||
// ol package | ||
# ol package | ||
npm install ol-echarts --save | ||
import EChartsLayer from 'ol-echarts' | ||
|
||
// 指定版本安装 | ||
# 指定版本安装 | ||
npm install [email protected] --save | ||
import ol3Echarts from 'ol3-echarts' | ||
|
||
npm install [email protected] --save | ||
import EChartsLayer from 'ol-echarts' | ||
|
||
``` | ||
|
||
#### cdn | ||
|
||
> cdn 引用方式只支持 旧版 `openlayers` 和新版 `ol` 的cdn引用方式,统一使用 `ol3-echarts` 支持。 | ||
|
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,193 @@ | ||
--- | ||
id: bar | ||
title: 柱状图 | ||
--- | ||
|
||
### 示例 | ||
|
||
```jsx live | ||
function render(props) { | ||
const container = useRef(null); | ||
|
||
const initChat = (map, option) => { | ||
const chart = new EChartsLayer(option, { | ||
hideOnMoving: false, | ||
hideOnZooming: true, | ||
}); | ||
|
||
chart.appendTo(map); | ||
} | ||
|
||
const init = async () => { | ||
const map = new ol.Map({ | ||
target: container.current, | ||
view: new ol.View({ | ||
projection: 'EPSG:4326', | ||
zoom: 3, | ||
rotation: 0, | ||
center: [113.53450137499999, 34.44104525], | ||
}), | ||
layers: [ | ||
new TileLayer({ | ||
source: new XYZ({ | ||
url: 'https://{a-c}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png', | ||
}), | ||
}), | ||
], | ||
}); | ||
|
||
const option = { | ||
color: ['#3398DB'], | ||
tooltip: { | ||
trigger: 'axis', | ||
axisPointer: { // 坐标轴指示器,坐标轴触发有效 | ||
type: 'shadow', // 默认为直线,可选为:'line' | 'shadow' | ||
}, | ||
}, | ||
legend: { | ||
x: 'right', | ||
show: true, | ||
data: ['包租费', '物业费', '水电', '网络', '燃气'], | ||
selectedMode: 'multiple', | ||
textStyle: { | ||
color: '#fff' | ||
} | ||
}, | ||
grid: [], | ||
xAxis: [], | ||
yAxis: [], | ||
series: [], | ||
}; | ||
|
||
const series = [ | ||
{ | ||
name: '包租费', | ||
type: 'bar', | ||
barWidth: '15', | ||
coordinates: [87.1435546875, 43.79150390625], | ||
data: [20, 12, 31, 34, 31], | ||
xAxisIndex: 0, | ||
yAxisIndex: 0, | ||
}, | ||
{ | ||
name: '物业费', | ||
type: 'bar', | ||
barWidth: '15', | ||
coordinates: [86.5283203125, 32.40966796875], | ||
data: [1, 1, 2, 3, 1], | ||
xAxisIndex: 1, | ||
yAxisIndex: 1, | ||
}, | ||
{ | ||
name: '水电', | ||
type: 'bar', | ||
barWidth: '15', | ||
coordinates: [98.876953125, 35.74951171875], | ||
data: [1, 1, 2, 3, 1], | ||
xAxisIndex: 2, | ||
yAxisIndex: 2, | ||
}, | ||
{ | ||
name: '网络', | ||
type: 'bar', | ||
barWidth: '15', | ||
coordinates: [108.80859375, 23.44482421875], | ||
data: [1, 1, 2, 3, 1], | ||
xAxisIndex: 3, | ||
yAxisIndex: 3, | ||
}, | ||
{ | ||
name: '燃气', | ||
type: 'bar', | ||
barWidth: '15', | ||
coordinates: [110.53450137499999, 38.44104525], | ||
data: [1, 1, 2, 3, 1], | ||
xAxisIndex: 4, | ||
yAxisIndex: 4, | ||
}, | ||
]; | ||
|
||
series.forEach((item, index) => { | ||
const grid = { | ||
show: true, | ||
containLabel: false, | ||
borderWidth: 0, | ||
borderColor: '#fff', | ||
width: 150, | ||
height: 80, | ||
}; | ||
option.grid.push(grid); | ||
option.xAxis.push({ | ||
type: 'category', | ||
show: true, | ||
gridIndex: index, | ||
nameTextStyle: { | ||
color: '#3c3c3c', | ||
}, | ||
axisLine: { | ||
show: false, | ||
onZero: false, | ||
}, | ||
axisLabel: { | ||
show: false, | ||
interval: 0, | ||
rotate: -45, | ||
textStyle: { | ||
color: '#3c3c3c', | ||
fontSize: 10, | ||
}, | ||
}, | ||
axisTick: { | ||
show: false, | ||
}, | ||
data: ['新虹桥', '中山公园', '虹桥', '镇宁路', '天山古北'], | ||
}); | ||
|
||
option.yAxis.push({ | ||
type: 'value', | ||
show: true, | ||
min: 0.001, | ||
splitLine: { show: false }, | ||
axisLabel: { | ||
show: false, | ||
}, | ||
axisLine: { | ||
show: false, | ||
onZero: false, | ||
}, | ||
nameGap: '1', | ||
axisTick: { | ||
show: false, | ||
}, | ||
nameTextStyle: { | ||
color: '#3c3c3c', | ||
fontSize: 14, | ||
}, | ||
gridIndex: index, | ||
}); | ||
option.series.push(item); | ||
}); | ||
|
||
initChat(map, option); | ||
|
||
function resize(target) {} | ||
|
||
return { | ||
resize, | ||
} | ||
} | ||
|
||
useEffect(() => { | ||
const { resize } = init(); | ||
|
||
return () => { | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<div className="live-wrap"> | ||
<div ref={container} className="map-content" /> | ||
</div> | ||
); | ||
} | ||
``` |
Oops, something went wrong.