Skip to content

Edges visibility fix in the docs#2015

Open
adam-urbanczyk wants to merge 8 commits intomasterfrom
vtkjs-doc-fix
Open

Edges visibility fix in the docs#2015
adam-urbanczyk wants to merge 8 commits intomasterfrom
vtkjs-doc-fix

Conversation

@adam-urbanczyk
Copy link
Member

@adam-urbanczyk adam-urbanczyk commented Mar 17, 2026

Solves #1998

@adam-urbanczyk adam-urbanczyk marked this pull request as draft March 17, 2026 07:28
@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.00%. Comparing base (8290128) to head (6877b5c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2015   +/-   ##
=======================================
  Coverage   95.00%   95.00%           
=======================================
  Files          30       30           
  Lines        8742     8749    +7     
  Branches     1298     1298           
=======================================
+ Hits         8305     8312    +7     
  Misses        289      289           
  Partials      148      148           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adam-urbanczyk adam-urbanczyk marked this pull request as ready for review March 17, 2026 19:10
Copy link
Member

@lorenzncode lorenzncode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is one issue with jupyter_tools.:

Image

I tested a fix like this:

def display(shape):

    payload: List[Dict[str, Any]] = []

    if isinstance(shape, Shape):
        shape_faces, shape_edges = toString(shape)

        payload.append(
            dict(
                shape=shape_edges,
                color=(0.0, 0.0, 0.0, 1.0),
                position=[0, 0, 0],
                orientation=[0, 0, 0],
            )
        )
        payload.append(
            dict(
                shape=shape_faces,
                color=DEFAULT_COLOR + (1,),
                position=[0, 0, 0],
                orientation=[0, 0, 0],
            )
        )
    elif isinstance(shape, Assembly):
        payload = toJSON(shape)
    else:
        raise ValueError(f"Type {type(shape)} is not supported")

    code = TEMPLATE.format(data=dumps(payload), element="element", ratio=0.5)

    return Javascript(code)

@adam-urbanczyk
Copy link
Member Author

Thanks for the catch @lorenzncode ! Fixed now. BTW: in the long term we might need to go for your approach to be able to color individual faces. Do you know if there is a way to serialize the mapping in vtk and deserialize in vtk.js?

Copy link
Member

@jmwright jmwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @adam-urbanczyk !

@lorenzncode
Copy link
Member

Thanks for the catch @lorenzncode ! Fixed now. BTW: in the long term we might need to go for your approach to be able to color individual faces. Do you know if there is a way to serialize the mapping in vtk and deserialize in vtk.js?

Thanks @adam-urbanczyk ! Regarding the mapping, I don't know. I have not tested something like that yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants