Skip to content

Commit

Permalink
update: update build flow
Browse files Browse the repository at this point in the history
  • Loading branch information
sakitam-fdd committed Nov 3, 2024
1 parent 1e063ec commit 70cc98d
Show file tree
Hide file tree
Showing 66 changed files with 21,558 additions and 15,250 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
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)
11 changes: 11 additions & 0 deletions .changeset/config.json
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": []
}
6 changes: 6 additions & 0 deletions .changeset/nice-camels-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'ol3-echarts': patch
'ol-echarts': patch
---

update build flow
3 changes: 3 additions & 0 deletions .github/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ runs:
${{ runner.os }}-pnpm-store-
- run: pnpm install
shell: bash
- name: Install playwright browsers
run: npx playwright install --with-deps
shell: bash
35 changes: 35 additions & 0 deletions .github/workflows/docs.yml
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
11 changes: 3 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
#env:
# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
# TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

jobs:
autofix:
Expand All @@ -25,8 +25,3 @@ jobs:

- run: pnpm turbo lint -- --fix
if: ${{ failure() || success() }}
- run: pnpm manypkg fix
if: ${{ failure() || success() }}
- run: pnpm format-fix
if: ${{ failure() || success() }}

15 changes: 7 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ concurrency:

jobs:
build:
# only run on PRs
if: github.event_name == 'pull_request'
timeout-minutes: 10
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
# env:
# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
# TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

runs-on: ubuntu-latest

Expand All @@ -27,9 +26,9 @@ jobs:
- run: pnpm turbo --filter build
test:
timeout-minutes: 10
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
# env:
# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
# TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

runs-on: ubuntu-latest

Expand All @@ -40,7 +39,7 @@ jobs:
- uses: ./.github/setup

- run: pnpm turbo --filter build
- run: pnpm test-ci
- run: pnpm test

- uses: codecov/codecov-action@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ on:
jobs:
publish:
timeout-minutes: 10
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
# env:
# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
# TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

runs-on: ubuntu-latest

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ coverage
/docs/api/
/docs/docs/typedoc/
/docs/.docusaurus/
/docs/build/
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.16.1
v20.18.0
7 changes: 4 additions & 3 deletions docs/docs/guide/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` 支持。
Expand Down
193 changes: 193 additions & 0 deletions docs/docs/playgrounds/bar.mdx
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>
);
}
```
Loading

0 comments on commit 70cc98d

Please sign in to comment.