You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Typescript i am unable to set the styles 'text-rotation', 'source-text-rotation' and 'target-text-rotation' to the string 'autorotate' as described in the documentation under the point "Rotating text" because these only accept numbers as values.
Desired behaviour
Be able to use the autorotate feature when using Typescript.
Minimum steps to reproduce
Make a Typescript project.
Import Cytoscape,js
Try Setting style 'text-rotation', 'source-text-rotation' or 'target-text-rotation' to 'autorotate'
Try to Compile and get The Error: 'TS2322: Type 'string' is not assignable to type 'number | MapperFunction<EdgeSingular, number> | undefined'.'
There are definitely some incorrect types (either out of date or that were always incorrect) in the DefinitelyTyped definitions. There are no type definitions in this repository or shipped with the cytoscape.js packages.
You can either open a PR on that repo to fix them or use @ts-expect-error in your code with an informative comment about the correct behavior.
The code should behave correctly even if the type checks fail.
Issue type
Bug report
Environment info
Current (buggy) behaviour
When using Typescript i am unable to set the styles
'text-rotation'
,'source-text-rotation'
and'target-text-rotation'
to the string'autorotate'
as described in the documentation under the point "Rotating text" because these only accept numbers as values.Desired behaviour
Be able to use the autorotate feature when using Typescript.
Minimum steps to reproduce
'TS2322: Type 'string' is not assignable to type 'number | MapperFunction<EdgeSingular, number> | undefined'.'
Example Style:
The text was updated successfully, but these errors were encountered: