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

Build goes green #18

Merged
merged 3 commits into from
Oct 23, 2024
Merged

Build goes green #18

merged 3 commits into from
Oct 23, 2024

Conversation

cloke
Copy link
Contributor

@cloke cloke commented Oct 23, 2024

This pull request involves several changes aimed at improving type safety and code clarity in the ember-apache-echarts/src/modifiers/bar-chart.ts file. The main changes include adding clarifying comments to @ts-expect-error annotations and refining imports to optimize bundle size.

Type Safety and Code Clarity Improvements:

Import Optimization:

  • Refined imports to optimize bundle size by importing only the required components from echarts/core. (ember-apache-echarts/src/modifiers/bar-chart.ts)

cloke and others added 3 commits October 22, 2024 13:42
…5.5 and add types

Refactor `abstract-chart.ts` to use direct imports from apache-echarts 5.5 and add TypeScript types.

* **Imports**
  - Replace `import * as echarts from 'echarts'` with direct imports from `echarts/core`, `echarts/renderers`, `echarts/components`, and `echarts/charts`.
  - Add `use` function to register necessary components and charts.

* **TypeScript Types**
  - Add TypeScript types for `ChartArgs`, `Context`, `Layout`, `Style`, `BoxConfig`, `TitleConfig`, `LegendConfig`, `DataZoomConfig`, `TextConfig`, `GraphicElement`, `GraphicConfig`, `EChartsConfig`, `EChartsOptionWithGraphic`, `EChartsOptionWithTitle`, `EChartsOptionWithLegend`, `EChartsOptionWithDataZoom`, `EChartsOptionWithTooltip`, `EChartsOptionWithGrid`, `EChartsOptionWithSeries`, and `EChartsOptionWithAll`.
  - Update method signatures to include TypeScript types.
  - Add optional chaining and type assertions where necessary.

* **Methods**
  - Update `createChart` method to use `init` from `echarts/core`.
  - Update `configureChart`, `buildLayout`, `addChartBox`, `addTitle`, `addLegend`, `addDataZoom`, `addCellBoxes`, `addCellTitles`, `addCellPlots`, `addCellTextOverlays`, `getLegendLabels`, `getLegendOrientation`, `generateBoxConfig`, `generateTitleConfig`, `generateLegendConfig`, `generateXAxisDataZoomConfig`, `generateYAxisDataZoomConfig`, `generateDataZoomConfigElement`, `generateTextConfig`, and `computeLegendMetrics` methods to use the new types and direct imports.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/crunchybananas/ember-apache-echarts?shareId=XXXX-XXXX-XXXX-XXXX).
@cloke cloke merged commit 99219f3 into main Oct 23, 2024
2 checks passed
@cloke cloke deleted the ghcw-session-eba4 branch November 21, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant