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

Prepare release v0.3.0 #199

Merged
merged 50 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
832c02a
Merge pull request #182 from hatemhosny/main
hatemhosny Sep 1, 2024
71632a7
ci: add "Preview in LiveCodes" github action
hatemhosny Sep 1, 2024
096a8a9
Merge pull request #183 from hatemhosny/preview-in-livecodes
hatemhosny Sep 1, 2024
3162563
ci: add TS demo for github action
hatemhosny Sep 1, 2024
37191b8
ci: add demos for "Preview in LiveCodes" github action
hatemhosny Sep 1, 2024
dde9027
edit ci demo
hatemhosny Sep 1, 2024
4a83190
Merge pull request #184 from hatemhosny/add-preview-in-livecodes-demos
hatemhosny Sep 1, 2024
ff3e407
edit docs
hatemhosny Sep 1, 2024
ea3352f
fix ci demo title
hatemhosny Sep 1, 2024
6312407
Merge pull request #185 from hatemhosny/edit-docs
hatemhosny Sep 1, 2024
01a3767
Add a validation step for options
AhmedElbohoty Sep 1, 2024
00015fc
feat(website): add search
hatemhosny Sep 3, 2024
d8820c7
Merge pull request #188 from hatemhosny/add-search
hatemhosny Sep 3, 2024
32c482a
Refactor validate options function
AhmedElbohoty Sep 3, 2024
82c356b
Merge branch 'hatemhosny:develop' into develop
AhmedElbohoty Sep 3, 2024
e277709
update race function to validate options
AhmedElbohoty Sep 3, 2024
b32280a
ci: fix start release
hatemhosny Sep 4, 2024
ff9e5d7
Merge pull request #193 from hatemhosny/fix-start-release
hatemhosny Sep 4, 2024
eb2a353
feat(styles): make the chart text & controls responsive
hatemhosny Sep 4, 2024
b75dedb
fix(renderer): avoid icons overflow outside bars
hatemhosny Sep 4, 2024
572a516
edit pr preview demos
hatemhosny Sep 4, 2024
ab16b15
Merge pull request #194 from hatemhosny/responsive
hatemhosny Sep 4, 2024
9b6e8b4
Add tests for valdate options functions
AhmedElbohoty Sep 4, 2024
de55f78
Add more type-safety
AhmedElbohoty Sep 5, 2024
e3fb7ff
Remove shadow variables
AhmedElbohoty Sep 5, 2024
0dccf85
Merge pull request #186 from AhmedElbohoty/develop
hatemhosny Sep 5, 2024
94aadd5
fix(data): fix passing data to worker
hatemhosny Sep 5, 2024
a023795
feat(website): add options editor GUI
hatemhosny Sep 5, 2024
daec0cd
feat(renderer): resize chart on resizing root element
hatemhosny Sep 5, 2024
f4f7874
cleanup API methods
hatemhosny Sep 5, 2024
b53cac4
fix typo
hatemhosny Sep 5, 2024
3d2fd00
fix website build
hatemhosny Sep 5, 2024
9d47d7a
Merge pull request #195 from hatemhosny/website-options-editor
hatemhosny Sep 5, 2024
4127c7a
feat(options): add labelPositions `"none"`
hatemhosny Sep 6, 2024
a5adf61
fix(renderer): fix icons clipPath
hatemhosny Sep 6, 2024
1d851d9
docs(options): add docs for "icon-only" bars
hatemhosny Sep 6, 2024
b01eeac
Merge pull request #196 from hatemhosny/labelsPosition-none
hatemhosny Sep 6, 2024
330202a
feat(options): add the option `valueDecimals`
hatemhosny Sep 6, 2024
a89e6a6
add docs
hatemhosny Sep 6, 2024
7991d4c
fix
hatemhosny Sep 7, 2024
3d10a1f
lint
hatemhosny Sep 7, 2024
b453984
fix lint
hatemhosny Sep 7, 2024
80584ca
fix(api): re-prepare data when `makeCumulative` option is changed by …
hatemhosny Sep 7, 2024
25eccb7
docs(data): add docs for data transformation guide
hatemhosny Sep 7, 2024
a2f3fed
fix links in docs
hatemhosny Sep 7, 2024
4da9523
test(options): add test for validating `valueDecimals` option
hatemhosny Sep 7, 2024
ae94970
fix(options): fix colorMap validation
hatemhosny Sep 7, 2024
83c625d
Merge pull request #197 from hatemhosny/value-decimals
hatemhosny Sep 7, 2024
1dae8ce
release: v0.3.0
hatemhosny Sep 7, 2024
a036430
add credit in release notes
hatemhosny Sep 7, 2024
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
21 changes: 21 additions & 0 deletions .github/workflows/livecodes-post-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: comment

on:
workflow_run:
workflows: ['livecodes'] # the workflow that created the artifact
types:
- completed

jobs:
upload:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'

steps:
- uses: live-codes/pr-comment-from-artifact@v1
with:
GITHUB_TOKEN: ${{ github.token }}
18 changes: 18 additions & 0 deletions .github/workflows/livecodes-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: livecodes

on: [pull_request]

jobs:
build_and_prepare:
runs-on: ubuntu-latest
name: Generate Playgrounds
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build and generate
uses: live-codes/preview-in-livecodes@v1
with:
install-command: 'npm install'
build-command: 'npm run build'
base-url: 'https://deploy-preview-{{LC::PR}}--racingbars.netlify.app/'
26 changes: 26 additions & 0 deletions .livecodes/js-esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"title": "JavaScript (ESM)",
"activeEditor": "script",
"markup": {
"language": "html",
"content": "<div id=\"race\">Loading...</div>"
},
"style": {
"language": "css",
"content": "#race {\n height: 80vh;\n}\n"
},
"script": {
"language": "javascript",
"content": "import { race } from \"racing-bars\";\n\n/** @type {import('racing-bars').Options} */\nconst options = {\n dataTransform: (data) =>\n data.map((d) => ({\n ...d,\n icon: `https://flagsapi.com/${d.code}/flat/64.png`,\n })),\n title: \"World Population\",\n subTitle: \"Country Population in millions\",\n caption: \"Source: World Bank\",\n dateCounter: \"YYYY\",\n showIcons: true,\n labelsPosition: \"outside\",\n};\n\nrace(\"{{LC::TO_URL(./data/population.csv)}}\", \"#race\", options);\n"
},
"customSettings": {
"imports": {
"racing-bars": "{{LC::TO_URL(./lib/racing-bars.js)}}",
"racing-bars/react": "{{LC::TO_URL(./lib/react.js)}}",
"racing-bars/vue": "{{LC::TO_URL(./lib/vue.js)}}"
},
"types": {
"racing-bars": "{{LC::TO_URL(./lib/racing-bars.d.ts)}}"
}
}
}
26 changes: 26 additions & 0 deletions .livecodes/js-umd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"title": "JavaScript (UMD)",
"activeEditor": "script",
"markup": {
"language": "html",
"content": "<div id=\"race\">Loading...</div>\n\n<script src=\"{{LC::TO_URL(./lib/racing-bars.umd.js)}}\"></script>"
},
"style": {
"language": "css",
"content": "#race {\n height: 80vh;\n}\n"
},
"script": {
"language": "javascript",
"content": "const options = {\n dataTransform: (data) =>\n data.map((d) => ({\n ...d,\n icon: `https://flagsapi.com/${d.code}/flat/64.png`,\n })),\n title: \"World Population\",\n subTitle: \"Country Population in millions\",\n caption: \"Source: World Bank\",\n dateCounter: \"YYYY\",\n showIcons: true,\n labelsPosition: \"outside\",\n};\n\nracingBars.race(\"{{LC::TO_URL(./data/population.csv)}}\", \"#race\", options);\n"
},
"customSettings": {
"imports": {
"racing-bars": "{{LC::TO_URL(./lib/racing-bars.js)}}",
"racing-bars/react": "{{LC::TO_URL(./lib/react.js)}}",
"racing-bars/vue": "{{LC::TO_URL(./lib/vue.js)}}"
},
"types": {
"racing-bars": "{{LC::TO_URL(./lib/racing-bars.d.ts)}}"
}
}
}
22 changes: 22 additions & 0 deletions .livecodes/react.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"title": "React",
"activeEditor": "script",
"style": {
"language": "css",
"content": ".race {\n height: 80vh;\n}\n"
},
"script": {
"language": "jsx",
"content": "import RacingBars from \"racing-bars/react\";\n\nexport default function App() {\n /** @type {import('racing-bars').Options} */\n const options = {\n dataUrl: \"{{LC::TO_URL(./data/population.csv)}}\",\n dataTransform: (data) =>\n data.map((d) => ({\n ...d,\n icon: `https://flagsapi.com/${d.code}/flat/64.png`,\n })),\n title: \"World Population\",\n subTitle: \"Country Population in millions\",\n caption: \"Source: World Bank\",\n dateCounter: \"YYYY\",\n showIcons: true,\n labelsPosition: \"outside\",\n };\n\n return <RacingBars className=\"race\" {...options}>Loading...</RacingBars>;\n}\n"
},
"customSettings": {
"imports": {
"racing-bars": "{{LC::TO_URL(./lib/racing-bars.js)}}",
"racing-bars/react": "{{LC::TO_URL(./lib/react.js)}}",
"racing-bars/vue": "{{LC::TO_URL(./lib/vue.js)}}"
},
"types": {
"racing-bars": "{{LC::TO_URL(./lib/racing-bars.d.ts)}}"
}
}
}
18 changes: 18 additions & 0 deletions .livecodes/svelte.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"title": "Svelte",
"activeEditor": "script",
"script": {
"language": "svelte",
"content": "<script>\n import { onMount } from \"svelte\";\n import { race } from \"racing-bars\";\n\n const options = {\n dataTransform: (data) =>\n data.map((d) => ({\n ...d,\n icon: `https://flagsapi.com/${d.code}/flat/64.png`,\n })),\n title: \"World Population\",\n subTitle: \"Country Population in millions\",\n caption: \"Source: World Bank\",\n dateCounter: \"YYYY\",\n showIcons: true,\n labelsPosition: \"outside\",\n };\n\n onMount(() => {\n race(\"{{LC::TO_URL(./data/population.csv)}}\", \"#race\", options);\n });\n</script>\n\n<div id=\"race\">Loading...</div>\n\n<style>\n #race {\n height: 80vh;\n }\n</style>\n"
},
"customSettings": {
"imports": {
"racing-bars": "{{LC::TO_URL(./lib/racing-bars.js)}}",
"racing-bars/react": "{{LC::TO_URL(./lib/react.js)}}",
"racing-bars/vue": "{{LC::TO_URL(./lib/vue.js)}}"
},
"types": {
"racing-bars": "{{LC::TO_URL(./lib/racing-bars.d.ts)}}"
}
}
}
26 changes: 26 additions & 0 deletions .livecodes/ts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"title": "TypeScript",
"activeEditor": "script",
"markup": {
"language": "html",
"content": "<div id=\"race\">Loading...</div>"
},
"style": {
"language": "css",
"content": "#race {\n height: 80vh;\n}\n"
},
"script": {
"language": "typescript",
"content": "import { race, type Options } from \"racing-bars\";\n\nconst options: Options = {\n dataTransform: (data) =>\n data.map((d) => ({\n ...d,\n icon: `https://flagsapi.com/${d.code}/flat/64.png`,\n })),\n title: \"World Population\",\n subTitle: \"Country Population in millions\",\n caption: \"Source: World Bank\",\n dateCounter: \"YYYY\",\n showIcons: true,\n labelsPosition: \"outside\",\n};\n\nrace(\"{{LC::TO_URL(./data/population.csv)}}\", \"#race\", options);\n"
},
"customSettings": {
"imports": {
"racing-bars": "{{LC::TO_URL(./lib/racing-bars.js)}}",
"racing-bars/react": "{{LC::TO_URL(./lib/react.js)}}",
"racing-bars/vue": "{{LC::TO_URL(./lib/vue.js)}}"
},
"types": {
"racing-bars": "{{LC::TO_URL(./lib/racing-bars.d.ts)}}"
}
}
}
18 changes: 18 additions & 0 deletions .livecodes/vue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"title": "Vue",
"activeEditor": "script",
"script": {
"language": "vue",
"content": "<script setup>\n import RacingBars from \"racing-bars/vue\";\n\n const options = {\n dataUrl: \"{{LC::TO_URL(./data/population.csv)}}\",\n dataTransform: (data) =>\n data.map((d) => ({\n ...d,\n icon: `https://flagsapi.com/${d.code}/flat/64.png`,\n })),\n title: \"World Population\",\n subTitle: \"Country Population in millions\",\n caption: \"Source: World Bank\",\n dateCounter: \"YYYY\",\n showIcons: true,\n labelsPosition: \"outside\",\n };\n</script>\n\n<template>\n <RacingBars class=\"race\" v-bind=\"options\">Loading...</RacingBars>\n</template>\n\n<style scoped>\n .race {\n height: 80vh;\n }\n</style>\n"
},
"customSettings": {
"imports": {
"racing-bars": "{{LC::TO_URL(./lib/racing-bars.js)}}",
"racing-bars/react": "{{LC::TO_URL(./lib/react.js)}}",
"racing-bars/vue": "{{LC::TO_URL(./lib/vue.js)}}"
},
"types": {
"racing-bars": "{{LC::TO_URL(./lib/racing-bars.d.ts)}}"
}
}
}
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,38 @@ All notable changes to this project will be documented in this file. See [standa

---

## [v0.3.0](https://github.com/hatemhosny/racing-bars/compare/v0.2.0...v0.3.0) (2024-09-07)

### Highlights for this release

- The charts are now responsive and works much better on smaller screens. Dynamically resizing the container element will also resize the chart.
- Added the option `valueDecimals` to control decimal spaces.
- The `labelsPosition` option can now be set to `"none"` to hide the labels (e.g. for icons only).

In addition to some bug fixes.

The website homepage now has a GUI editor for chart options. Also added search capability in the website.

Thank you @AhmedElbohoty for the valuable contribution.

### Bug Fixes

- **api:** re-prepare data when `makeCumulative` option is changed by `changeOptions` API method ([80584ca](https://github.com/hatemhosny/racing-bars/commit/80584ca3622499a4b5c6e2b7f6b070ac31bfa758))
- **data:** fix passing data to worker ([94aadd5](https://github.com/hatemhosny/racing-bars/commit/94aadd5a0bd3ebc7ec917dd3eacb43c7f8c132b5))
- **renderer:** avoid icons overflow outside bars ([b75dedb](https://github.com/hatemhosny/racing-bars/commit/b75dedb51cde6778431a97d85c4000a104c993e8))

### Features

- **options:** add labelPositions `"none"` ([4127c7a](https://github.com/hatemhosny/racing-bars/commit/4127c7a5dd49c5add1b1bf323815d0ccef965ec3))
- **options:** add the option `valueDecimals` ([330202a](https://github.com/hatemhosny/racing-bars/commit/330202aa7b432e2ff6b509128c0da53226b3d064))
- **options:** validate options ([0dccf85](https://github.com/hatemhosny/racing-bars/commit/0dccf850d4af29eda795a37490606dc11f80cf9c))
- **renderer:** resize chart on resizing root element ([daec0cd](https://github.com/hatemhosny/racing-bars/commit/daec0cdebf95d15736edc52a4101fdd14c231f47))
- **styles:** make the chart text & controls responsive ([eb2a353](https://github.com/hatemhosny/racing-bars/commit/eb2a35341dcda6fbfe3563d7c7cfc1d5f5253430))
- **website:** add options editor GUI ([a023795](https://github.com/hatemhosny/racing-bars/commit/a023795a1f78bbb7ae3562a736641f09d50245b6))
- **website:** add search ([00015fc](https://github.com/hatemhosny/racing-bars/commit/00015fce403e40099c8288a4d6fd4e6fffe32d71))

---

## [v0.2.0](https://github.com/hatemhosny/racing-bars/compare/v0.1.2...v0.2.0) (2024-09-01)

### Bug Fixes
Expand Down
Loading
Loading