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

Typescript definition for node/edge data #1359

Closed
sim51 opened this issue May 16, 2023 · 1 comment
Closed

Typescript definition for node/edge data #1359

sim51 opened this issue May 16, 2023 · 1 comment

Comments

@sim51
Copy link
Collaborator

sim51 commented May 16, 2023

Program process function

Sigma allows developer to create node's program, but the definition of the NodeDisplayData can't be extended.

For example, if I want to write a program that do a circle and a border with their color and size managed by the data, it's not possible. I can't add the attributs borderSize and borderColor for example.

For now, TS allows to extend the NodeDisplayData in program's process function.

export default class NodeProgramBorder extends AbstractNodeProgram {
  ...
  process(
      data: NodeDisplayData & { borderSize?: number; borderColor?: string },
      hidden: boolean,
      offset: number
    ): void {
   ...
  }
...
}

TS compile, even if in pure object conception, it should not.

Propagation of the graph type

The graph types are not propagated deeply in the code base of sigma, like in the node/edge reducer for example

@sim51 sim51 changed the title Typescript definition for node data on program's process function Typescript definition for node/edge data May 16, 2023
@jacomyal
Copy link
Owner

jacomyal commented Oct 3, 2023

@sim51 has recently worked on that for v3, there is a branch v3-graph-typing with an implementation, that should be shipped with next v3 alpha or beta release.

jacomyal added a commit that referenced this issue Mar 7, 2024
Details:
- Makes the Attributes override optional everywhere
- Puts the UNIFORMS as the first generic for all programs
@jacomyal jacomyal closed this as completed Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants