{"id":19440352,"url":"https://github.com/devinit/charts","last_synced_at":"2025-07-06T00:04:48.095Z","repository":{"id":21684878,"uuid":"90874067","full_name":"devinit/charts","owner":"devinit","description":"draw configurable d3 charts from csv like data (built on top of plottable)","archived":false,"fork":false,"pushed_at":"2025-07-03T04:33:11.000Z","size":4839,"stargazers_count":4,"open_issues_count":25,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-03T05:29:51.713Z","etag":null,"topics":["charts","d3","plottable","typescript"],"latest_commit_sha":null,"homepage":"https://devinit.github.io/charts/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devinit.png","metadata":{"files":{"readme":"Readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-05-10T14:33:06.000Z","updated_at":"2022-12-21T10:16:29.000Z","dependencies_parsed_at":"2023-09-26T19:38:42.834Z","dependency_job_id":"34523e19-2089-4837-9ca4-a0a70ffe6aec","html_url":"https://github.com/devinit/charts","commit_stats":{"total_commits":593,"total_committers":5,"mean_commits":118.6,"dds":0.3187183811129848,"last_synced_commit":"4a71de1a7067f03e719f5fe43b166c483a5bf850"},"previous_names":[],"tags_count":125,"template":false,"template_full_name":null,"purl":"pkg:github/devinit/charts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinit%2Fcharts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinit%2Fcharts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinit%2Fcharts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinit%2Fcharts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devinit","download_url":"https://codeload.github.com/devinit/charts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinit%2Fcharts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263270431,"owners_count":23440365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["charts","d3","plottable","typescript"],"created_at":"2024-11-10T15:28:54.835Z","updated_at":"2025-07-06T00:04:48.063Z","avatar_url":"https://github.com/devinit.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @devinit/charts\n\n[![Build Status](https://travis-ci.org/devinit/charts.svg?branch=master)](https://travis-ci.org/devinit/charts)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/539c39de03d64cb5b776ef388eef29d6)](https://www.codacy.com/app/epicallan/charts?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=devinit/charts\u0026amp;utm_campaign=Badge_Grade)\n[![Dependency Status](https://gemnasium.com/badges/github.com/devinit/charts.svg)](https://gemnasium.com/github.com/devinit/charts)\n\n# This library is undergoing some major refactoring, so current implementation in the readme file is for previous old code which you can find at https://github.com/freelyformd/charts\n\nconfigurable d3 charts from csv like data\n\n## Install\nFirstly, install `@devinit/charts`\n\n```\nnpm install @devinit/charts\n```\n\n## Developing\n\nrun ``` yarn --ignore-scripts ``` for installing dependencies\nTo start contributing, clone this repository and run `npm start`\n\nBrowse to localhost:8080, to see some charts\n\n## Usage\n\nThis library exposes a `draw` function that takes an object with the following properties;\n - element: a DOM node\n - config: a configuration object\n - data: a list of entries\n \nThe function returns an object with the following methods\n- update(data: Array): updates visualised data\n \n Example:\n```js\n\ndraw({\n    element: document.getElementById('area_chart'),\n    config: {\n        title: 'Area Chart',\n        type: 'area',\n        colors: ['#ba0c2f', '#93328e', '#b7bf10', '#004862'],\n        linearAxis: {\n            showAxis: true,\n            showGridlines: true,\n            axisLabel: 'Country',\n        },\n        categoryAxis: {\n            showAxis: true,\n            axisLabel: 'Area',\n        }\n    },\n    data: [\n        {\"Area\": 100, \"Country\": \"Uganda\"},\n        {\"Area\": 200, \"Country\": \"Kenya\"},\n        {\"Area\": 120, \"Country\": \"Tanzania\"},\n        {\"Area\": 270, \"Country\": \"Rwanda\"},\n        {\"Area\": 230, \"Country\": \"Burundi\"},\n    ]\n})\n\n```\n\nWith that you get an area chart inside the element with an id of `area-chart`. The configuration fields depend on the chart type. \n\n# Configuration\nThe following sections outline the accepted configuration fields for each supported chart type\n\n### Linear vs Category Charts\n\nThese consist of a linear axis and a category axis \n\n#### Chart types\n- area\n- bar\n- line\n- stacked-bar\n- stacked-area\n- full-stacked-bar\n- full-stacked-area\n- clustered-bar\n\n```js\nconst config = {\n    \n    title: 'Line Chart',\n\n    // title alignment: left/center/right,\n    titleAlignment: 'left',\n    \n    // orientation: vertical/horizontal,\n    orientation: 'vertical',\n  \n    linearAxis: {\n        // Whether or not to show axis component\n        showAxis: false,\n        // Whether or not to show grid lines\n        showGridlines: false,\n        // Data field for this axis\n        axisLabel: 'Area',\n        // Minimum axis value\n        axisMinimum: null,\n        // Maximum axis value\n        axisMaximum: null,\n    },\n\n    categoryAxis: {\n        // Whether or not to show axis component\n        showAxis: false,\n        // Data field for this axis\n        axisLabel: 'Countries',\n        // Padding between categories\n        innerPadding: 0,\n        // Padding between axes and end data categories\n        outerPadding: 0\n    },\n    \n    legend: {\n        // Whether or not to show legend\n        showLegend: false,\n        // Align of label items; left/center/right\n        alignment: 'left',\n        // Position of legend on chart: bottom/right\n        position: 'bottom',\n        // Shape of legend indicators: \n        // circle/square/cross/diamond/triangle/star/wye\n        symbol: 'square',\n        // Maximum entries per row\n        rowSpan: 1\n    }\n    \n}\n```\n\n### Circular Charts\n\nCircular charts include pie and donut charts\n\n```js\nconst data = {\n    type: 'pie',\n    \n    title: 'Donut Chart',\n    \n    titleAlignment: 'center',\n    \n    colors: ['#ba0c2f', '#93328e', '#b7bf10', '#004862'],\n    \n    circular: {\n        // Data field for label sectors\n        label: 'Country',\n        // Data field for sector values\n        value: 'Population',\n        // Inner radius for donut charts\n        innerRadius: 100,\n        // Stroke width and color around each sector\n        strokeWidth: 5,\n        strokeColor: '#fff',\n    },\n    \n    // See previous section\n    legend: {\n        showLegend: true,\n        position: 'bottom',\n        alignment: 'center'\n    }\n}\n```\n\n### Hierarchy Charts\n\nHierachy charts represent tree data e.g `tree-map`, `partition`, `grouped-vertical-stack`. Each series needs a parent identifier.\n\n#### Chart types\n- treemap\n- partition\n\n#### Configuration\n\n```js\nconst config = {\n      \n    title: 'Partition Chart',\n    type: 'partition',\n    orientation: 'horizontal',\n    \n    \n    tree: {\n        // unique node reference field\n        id: 'label',\n        // node parent reference field \n        parent: 'parent',\n        // node value field\n        value: 'value',\n        // Maximum visible node depth\n        depth: Infinity,\n    },\n    \n    // applies to type = treemap\n    treemap: {\n        // Tiling algorithm: \n        // binary/dice/slice/sliceDice/squarify/resquarify\n        tile: 'sliceDice',\n    \n    },\n    \n}\n```\n\n### 3D Charts (TODO)\n\n3D charts represent three dimensional data\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevinit%2Fcharts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevinit%2Fcharts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevinit%2Fcharts/lists"}