Skip to content

Commit

Permalink
Fixed bloated bundle size and typescript issue
Browse files Browse the repository at this point in the history
  • Loading branch information
paulosabayomi committed Oct 26, 2024
1 parent c3305e8 commit 43e1c32
Show file tree
Hide file tree
Showing 467 changed files with 42,488 additions and 18,097 deletions.
Binary file modified .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ jobs:
- run: npm run build --if-present
- run: npm run rollup
- run: npm run sass-c
- run: npm run build-ts
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

## 0.0.1 (2024-10-26)

- Fix: Bloated bundle size because of bundled faker-js, now bundle size reduced from 15mb to 5.1mb
- Fix: TypeScript not properly configured
- Changed: Loading of d3 through the script tag to import and packaged with the library, and also faker-js changed from `allFakers` to `faker`.
- Removed: `random_data_locale` parameter has been removed until later, because of the change from using `allFakers` to `faker`
19 changes: 5 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
</div>

<!-- [START BADGES] -->
<!-- Please keep comment here to allow auto update -->
<!-- [END BADGES] -->

Display your organization structure in style, personalize and use the chart type of your choice and that fits your organization, and more. Built with D3js and TypeScript.
Expand All @@ -17,21 +18,11 @@ npm i treeSpider

## Setup

After installation you can either import treeSpider directly in your application or load it with the script tag, it has both ES6 and browser bundles.
After installation you can either import treeSpider directly in your application or load it via the script tag, it has both ES6 and browser bundles.

### TypeScript
### ES6 import

```ts
import TreeSpider from '/path/to/installation/folder/treeSpider'

const instance1 = new TreeSpider({
targetContainer: '#container-1'
})
```

### JavaScript

```js
import TreeSpider from '/path/to/installation/folder/dist/es/treeSpider.bundle.min.js'

const instance1 = new TreeSpider({
Expand Down Expand Up @@ -62,7 +53,7 @@ After importing it or loading it with the script tag, add the CSS file
<link rel="stylesheet" href="/path/to/installation/folder/dist/css/treeSpider.css">
```

And that is it, you will see treeSpider running in the browser with random automatically generate data that displays in your locale language, and one cool thing is there is no limit to the number of TreeSpider instances that can be on a page, next add your organization employees data.
And that is it, you will see treeSpider running in the browser with random automatically generate data, and one cool thing is there is no limit to the number of TreeSpider instances that can be on a page, next add your organization employees data.

## Adding data

Expand All @@ -87,7 +78,7 @@ This is an example of an organization's employees data

```ts
const tree_data = [
{id: "1", name: "Abayomi AmusaOyediran", role: "Manager", location: "Lagos, Nigeria"},
{id: "1", name: "Abayomi Amusa", role: "Manager", location: "Lagos, Nigeria"},
{id: "2", parentId: "1", name: "Trey Anderson", role: "Product Manager", location: "California, United States"},
{id: "3", parentId: "1", name: "Troy Manuel", role: "Software Developer", location: "Alberta, Canada"},
{id: "4", parentId: "1", name: "Rebecca Oslon", role: "Software Developer", location: "London, United Kingdom"},
Expand Down
Binary file removed deps/.DS_Store
Binary file not shown.
Loading

0 comments on commit 43e1c32

Please sign in to comment.