Skip to content

Commit

Permalink
Merge pull request #164 from AhmedElbohoty/develop
Browse files Browse the repository at this point in the history
chore(deps): update packages
  • Loading branch information
hatemhosny authored Aug 25, 2024
2 parents bdeb1c4 + 01e9e5b commit daa6868
Show file tree
Hide file tree
Showing 13 changed files with 806 additions and 998 deletions.
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ build/
*.yml
*.yaml

website/static/lib/
LICENSE
PKG-INFO
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions website/docs/documentation/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ title: API

This page is an overview and a guide for usage.

The API TypeScript definitions are documented [here](../api/modules.md).
The API TypeScript definitions are documented [here](../api/globals.md).

## Functions:

### [loadData](/api/modules.md#loaddata)
### [loadData](../api/functions/loadData.md)

This function loads data from url.

Expand All @@ -34,7 +34,7 @@ racingBars.loadData('/data/population.csv', 'csv').then((data) => {
});
```

### [race](/api/modules.md#race)
### [race](../api/functions/race.md)

This is the main function that generates the racing bar chart.

Expand All @@ -52,7 +52,7 @@ This is the main function that generates the racing bar chart.
The chart container HTML element or a string representing a CSS selector for it. If not provided, a new `<div>` element is created, added to the document `<body>` and used.
Note that any content inside that element will be deleted before embedding the chart.

- options: [`Options`](../api/interfaces/internal.Options.md)
- options: [`Options`](../api/internal/interfaces/Options.md)

An optional configuration object for chart options. The options are documented in the ["Options" section](./options.md)

Expand Down Expand Up @@ -237,7 +237,7 @@ See the examples for [Slider](../gallery/slider.md) and [Scroller](../gallery/sc

### [Data](../api/interfaces/Data.md)

### [Options](../api/interfaces/internal.Options.md)
### [Options](../api/internal/interfaces/Options.md)

### [Race](../api/interfaces/Race.md)

Expand Down
2 changes: 1 addition & 1 deletion website/docs/documentation/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ import { race } from 'racing-bars';
race('long.csv', '#race', { dataType: 'csv' });
```

In addition, the [`loadData`](./api.md#loaddataurltype) function can be used to load data from a URL into a JavaScript array.
In addition, the [`loadData`](./api.md#loaddata) function can be used to load data from a URL into a JavaScript array.

```js
import { loadData, race } from 'racing-bars';
Expand Down
4 changes: 2 additions & 2 deletions website/docs/documentation/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ const options = {
race('/data/population.json', '#race', options);
```

Note that the transformation could have been done after loading the data with [`loadData`](../documentation/api.md#loaddataurl-type) method and before calling the [`race`](../documentation/api.md#racedata-options) method, as follows:
Note that the transformation could have been done after loading the data with [`loadData`](../documentation/api.md#loaddata) method and before calling the [`race`](../documentation/api.md#race) method, as follows:

```js
import { loadData, race } from 'racing-bars';
Expand Down Expand Up @@ -562,7 +562,7 @@ const options = {

### makeCumulative

If `true`, the values are converted to [cumulative sums](./data.md#cumulativesum) (running totals).
If `true`, the values are converted to [cumulative sums](./data.md#cumulative-sum) (running totals).

- Type: `boolean`
- Default: `false`
Expand Down
2 changes: 1 addition & 1 deletion website/docs/gallery/keyboard-controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ hide_table_of_contents: true

import RacingBars from '../../src/components/RacingBars';

A demo for using [`keyboardControls`](../documentation/options.md#keyboardControls).
A demo for using [`keyboardControls`](../documentation/options.md#keyboardcontrols).
See the guide on [`chart controls`](../guides/chart-controls.md).

<!--truncate-->
Expand Down
10 changes: 5 additions & 5 deletions website/docs/getting-started/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ After [installation](./installation.md), you can use the library in JavaScript a

The library exports the [`race`](../documentation/api.md#race) function, which creates the bar chart race. It has the following signature:

Type: [`race(data, container?, options?): Promise<Race>`](../api/modules.md#race)
Type: [`race(data, container?, options?): Promise<Race>`](../api/functions/race.md)

The function accepts the following parameters:

- `data`:

Type: [`Data`](/api/interfaces/Data.md)[] | `Promise`&lt;[`Data`](/api/interfaces/Data.md)[]&gt; | [`WideData`](/api/interfaces/WideData.md)[] | `Promise`&lt;[`WideData`](/api/interfaces/WideData.md)[]&gt; | `string`
Type: [`Data`](../api/interfaces/Data.md)[] | `Promise`&lt;[`Data`](../api/interfaces/Data.md)[]&gt; | [`WideData`](../api/interfaces/WideData.md)[] | `Promise`&lt;[`WideData`](../api/interfaces/WideData.md)[]&gt; | `string`

The data object, a promise that resolves to it or a URL to it.
See [section about data](../documentation/data.md) for details.
Expand All @@ -29,7 +29,7 @@ The function accepts the following parameters:

- `options`:

Type: `Partial`&lt;[`Options`](../api/interfaces/internal.Options.md)&gt;
Type: `Partial`&lt;[`Options`](../api/internal/interfaces/Options.md)&gt;

An optional configuration object. See [section about options](../documentation/options.md) for details

Expand Down Expand Up @@ -57,7 +57,7 @@ race('data/population.csv', '#race', options);

For convenience, the library also exports the [`loadData`](../documentation/api.md#loaddata) function to allow fetching data from URL.

Type: [`loadData(URL, type?): Promise<Data[]> | Promise<WideData[]>`](/api/modules.md#loadData)
Type: [`loadData(URL, type?): Promise<Data[]> | Promise<WideData[]>`](../api/functions/loadData.md)

It supports the following data formats, by specifying the second optional parameter:

Expand All @@ -80,7 +80,7 @@ loadData('data/population.csv', 'csv').then((data) => {

## TypeScript Support

The library supports TypeScript. Documentation for the TypeScript definitions can be found [here](../api/modules.md).
The library supports TypeScript. Documentation for the TypeScript definitions can be found [here](../api/globals.md).

```ts
import { race, type Options } from 'racing-bars';
Expand Down
4 changes: 2 additions & 2 deletions website/docs/guides/bar-colors.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The color assignment is consistent (every time the chart loads, each bar name ge

If the dataset contains a lot of names (or groups), the bar colors may start becoming near each other.

This default behaviour can be changed in different ways.
This default behavior can be changed in different ways.

## Change Default Colors

Expand Down Expand Up @@ -121,7 +121,7 @@ race('/data/population.json', '#race', options);
```

:::info
Notice that if groups are shown ([showGroups](#showgroups) is set to `true`, and the dataset has the field `group`),
Notice that if groups are shown ([showGroups](../documentation/options.md#showgroups) is set to `true`, and the dataset has the field `group`),
[`colorMap`](../documentation/options.md#colormap) option affects `group` colors, otherwise it affects `name` colors, but not both.
:::

Expand Down
2 changes: 1 addition & 1 deletion website/docs/guides/chart-size.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Chart Size
---

By default the chart will take the size of the [container element](../getting-started/usage.md#race).
By default the chart will take the size of the [container element](../documentation/api.md#race).
So, the chart can be easily sized by sizing that element (e.g. by CSS).

Example:
Expand Down
2 changes: 1 addition & 1 deletion website/docs/guides/themes-styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Example:

The chart styles are defined in CSS which is bundled in the JS library.
When the chart loads, the styles are dynamically injected in the top of the HTML document head.
The styles are scoped to the element specified by the [`selector`](../documentation/options.md#selector) option.
The styles are scoped to the [container element](../documentation/api.md#race).

The CSS used can be <a href="https://github.com/hatemhosny/racing-bars/tree/master/src/lib/css" target="_blank" className="external">found here</a>.

Expand Down
3 changes: 2 additions & 1 deletion website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const config: Config = {
},
{
label: 'Sponsor 💚',
href: 'sponsor',
to: 'sponsor',
},
],
},
Expand Down Expand Up @@ -152,6 +152,7 @@ const config: Config = {
},
],
plugins: [
['@docusaurus/plugin-debug', { id: 'debug' }],
[
'docusaurus-plugin-typedoc',
{
Expand Down
Loading

0 comments on commit daa6868

Please sign in to comment.