{"id":16800012,"url":"https://github.com/alxnddr/echarts-solid","last_synced_at":"2025-06-24T07:04:10.469Z","repository":{"id":202838412,"uuid":"708257416","full_name":"alxnddr/echarts-solid","owner":"alxnddr","description":"SolidJS components for ECharts","archived":false,"fork":false,"pushed_at":"2024-09-01T20:57:26.000Z","size":79,"stargazers_count":43,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-09T03:16:42.202Z","etag":null,"topics":["charting-library","charts","echarts","solidjs","visualizations"],"latest_commit_sha":null,"homepage":"","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/alxnddr.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2023-10-22T02:08:09.000Z","updated_at":"2025-05-08T06:19:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"c27f6cf9-85ce-4108-aa91-fdd72d53db5f","html_url":"https://github.com/alxnddr/echarts-solid","commit_stats":null,"previous_names":["alxnddr/echarts-solid"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxnddr%2Fecharts-solid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxnddr%2Fecharts-solid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxnddr%2Fecharts-solid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxnddr%2Fecharts-solid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alxnddr","download_url":"https://codeload.github.com/alxnddr/echarts-solid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253181442,"owners_count":21866995,"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":["charting-library","charts","echarts","solidjs","visualizations"],"created_at":"2024-10-13T09:30:29.908Z","updated_at":"2025-05-09T03:16:47.839Z","avatar_url":"https://github.com/alxnddr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp\u003e\n  \u003cimg width=\"100%\" src=\"https://assets.solidjs.com/banner?type=echarts-solid\u0026background=tiles\u0026project=%20\" alt=\"echarts-solid\"\u003e\n\u003c/p\u003e\n\n# echarts-solid\n\n[![pnpm](https://img.shields.io/badge/maintained%20with-pnpm-cc00ff.svg?style=for-the-badge\u0026logo=pnpm)](https://pnpm.io/)\n\n`echarts-solid` is a library that provides components for integrating ECharts with SolidJS apps. It includes two main components: `ECharts` and `EChartsAutoSize`, both designed to make it easier to work with ECharts in Solid-based projects.\n\n## Quick start\n\nInstall it:\n\n```bash\nnpm i echarts-solid echarts\n# or\nyarn add echarts-solid echarts\n# or\npnpm add echarts-solid echarts\n```\n\nUse it:\n\n```tsx\nimport { ECharts } from 'echarts-solid'\n\nfunction MyChartComponent() {\n  const options = {\n    // ... your ECharts option here\n  };\n\n  return (\n    \u003cECharts\n      option={options}\n      width={600}\n      height={400}\n    /\u003e\n  );\n}\n```\n\nFor responsive charts, use the `EChartsAutoSize` component:\n\n```tsx\nimport { EChartsAutoSize } from 'echarts-solid'\n\nfunction MyResponsiveChartComponent() {\n  const options = {\n    // ... your ECharts option here\n  };\n\n  return (\n    \u003cEChartsAutoSize\n      option={options}\n    /\u003e\n  );\n}\n```\n\n## Components\n\n### ECharts\n\n`ECharts` is a component that renders an ECharts chart with specified options and styles.\n\n#### Props\n\n- `option`: ECharts `option` object with data and configuration.\n- `width`, `height`: The dimensions of the chart.\n- `initOptions`: Optional parameters for the ECharts instance initialization.\n- `notMerge`: Whether not to merge with previous `option`.\n- `lazyUpdate`: Whether to update chart immediately.\n- `isLoading`: Displays a loading animation when the chart is being prepared or data is being fetched.\n- `loadingOptions`: The options for the loading animation.\n- `resizeOptions`: Options to pass to ECharts' resize method.\n- `theme`: Theme to be applied to the chart instance.\n- `eventHandlers`: An object to attach event handlers to the chart instance.\n- `onInit`: Callback function that is invoked with the chart instance when it is initialized.\n- `class`, `style`: Standard HTML attributes for styling.\n- `ref`: Ref of the div element that is used for the chart.\n\n### EChartsAutoSize\n\n`EChartsAutoSize` is similar to `ECharts` but automatically adjusts its size based on its container's size.\n\n#### Props\n\nIt has all the same props as ECharts, except for width and height because it adjusts to the chart element's size.\n\n## Events\n\nYou can attach event handlers to different chart events by passing an `eventHandlers` object. Each key is the event name, and the value can be the handler function or an object with `query` for filtering and `handler` for the function itself.\n\n```tsx\nconst eventHandlers = {\n  'click': (event: ECElementEvent) =\u003e {\n    console.log('Chart is clicked!', event);\n  }\n};\n\n\u003cEChartsAutoSize\n  option={options}\n  eventHandlers={eventHandlers}\n/\u003e\n```\n\n## Loading State\n\nYou can control the display of a loading animation by using the `isLoading` and `loadingOptions` props:\n\n```tsx\n\u003cEChartsAutoSize\n  option={options}\n  isLoading={true}\n  loadingOptions={{ text: 'Data is loading...' }}\n/\u003e\n```\n\n## Contributing\n\nContributions to the `echarts-solid` library are encouraged and appreciated.\n\n## License\n\n`echarts-solid` is [MIT licensed](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falxnddr%2Fecharts-solid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falxnddr%2Fecharts-solid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falxnddr%2Fecharts-solid/lists"}