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

Update peer dependency #694

Closed
reimer-atb opened this issue Nov 15, 2022 · 3 comments · Fixed by #695
Closed

Update peer dependency #694

reimer-atb opened this issue Nov 15, 2022 · 3 comments · Fixed by #695

Comments

@reimer-atb
Copy link

Current version 1.2.1 is incompatible with current chart.js 4.0.1:

npm ERR! Found: [email protected]
npm ERR! node_modules/chart.js
npm ERR!   chart.js@"4.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer chart.js@"^3.2.0" from [email protected]
npm ERR! node_modules/chartjs-plugin-zoom
npm ERR!   chartjs-plugin-zoom@"*" from the root project
@CoooWeee
Copy link

Same here.


Error: node_modules/chart.js/dist/chunks/helpers.core.d.ts:813:15 - error TS2428: All declarations of 'Chart$4' must have identical type parameters.

813 declare class Chart$4<
                  ~~~~~~~


Error: node_modules/chartjs-plugin-zoom/types/index.d.ts:2:35 - error TS2307: Cannot find module 'chart.js/types/utils' or its corresponding type declarations.

2 import { DistributiveArray } from 'chart.js/types/utils';
                                    ~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/chartjs-plugin-zoom/types/index.d.ts:16:8 - error TS2473: Enum declarations must all be const or non-const.

16   enum UpdateModeEnum {
          ~~~~~~~~~~~~~~


Error: node_modules/chartjs-plugin-zoom/types/index.d.ts:21:13 - error TS2428: All declarations of 'Chart$4' must have identical type parameters.

21   interface Chart<TType extends keyof ChartTypeRegistry = keyof ChartTypeRegistry, TData = DistributiveArray<ChartTypeRegistry[TType]['defaultDataPoint']>, TLabel = unknown> {
               ~~~~~


Error: node_modules/chartjs-plugin-zoom/types/index.d.ts:21:39 - error TS2552: Cannot find name 'ChartTypeRegistry'. Did you mean 'ScaleTypeRegistry'?

21   interface Chart<TType extends keyof ChartTypeRegistry = keyof ChartTypeRegistry, TData = DistributiveArray<ChartTypeRegistry[TType]['defaultDataPoint']>, TLabel = unknown> {
                                         ~~~~~~~~~~~~~~~~~


Error: node_modules/chartjs-plugin-zoom/types/index.d.ts:21:65 - error TS2552: Cannot find name 'ChartTypeRegistry'. Did you mean 'ScaleTypeRegistry'?

21   interface Chart<TType extends keyof ChartTypeRegistry = keyof ChartTypeRegistry, TData = DistributiveArray<ChartTypeRegistry[TType]['defaultDataPoint']>, TLabel = unknown> {
                                                                   ~~~~~~~~~~~~~~~~~


Error: node_modules/chartjs-plugin-zoom/types/index.d.ts:21:110 - error TS2552: Cannot find name 'ChartTypeRegistry'. Did you mean 'ScaleTypeRegistry'?

21   interface Chart<TType extends keyof ChartTypeRegistry = keyof ChartTypeRegistry, TData = DistributiveArray<ChartTypeRegistry[TType]['defaultDataPoint']>, TLabel = unknown> {

@StefanNedelchev
Copy link

the plugin is still not migrated for chart.js 4, we just have to wait

@hugo-valcourt
Copy link

hugo-valcourt commented Nov 17, 2022

I tried chart4 on my project (with --force), and I had no problem with chartjs-plugin-zoom.

I dont use all the options, but was working perfecly with those options

const zoom: DeepPartial<ZoomPluginOptions> = {
  limits: {
    x: {
      min: 'original',
      max: 'original',
      minRange: undefined
    },
    y: {
      min: 'original',
      max: 'original',
      minRange: undefined
    }
  },
  pan: {
    enabled: false,
    mode: 'x',
    modifierKey: undefined,
    overScaleMode: undefined,
    threshold: 10,
  },
  zoom: {
    mode: 'x',
    overScaleMode: undefined,
    wheel: {
      enabled: false,
      modifierKey: undefined, 
      speed: 0.1
    },
    pinch: {
      enabled: true
    },
    drag: {
      backgroundColor: 'rgba(105, 175, 235 ,0.3)',
      borderColor: 'rgba(225,225,225,0.3)',
      borderWidth: 2,
      enabled: true,
      modifierKey: undefined,
      threshold: 0
    }
  }
}

export default zoom

Should be easy to upgrade to chart4

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 a pull request may close this issue.

4 participants