Skip to content

Conversation

arjxn-py
Copy link
Member

@arjxn-py arjxn-py commented May 14, 2025

Description

Fix #693

sym.mp4

Checklist

  • PR has a descriptive title and content.
  • PR description contains references to any issues the PR resolves, e.g. Resolves #XXX.
  • PR has one of the labels: documentation, bug, enhancement, feature, maintenance
  • Checks are passing.
    Failing lint checks can be resolved with:
    • pre-commit run --all-files
    • jlpm run lint

📚 Documentation preview: https://jupytergis--697.org.readthedocs.build/en/697/
💡 JupyterLite preview: https://jupytergis--697.org.readthedocs.build/en/697/lite

Copy link
Contributor

Binder 👈 Launch a Binder on branch arjxn-py/jupytergis/symbology-color-steps

@arjxn-py arjxn-py added the bug Something isn't working label May 14, 2025
Copy link
Contributor

Integration tests report: appsharing.space

@arjxn-py arjxn-py requested a review from martinRenou May 14, 2025 12:27
output: color[key][i + 1]
});
const pairKey = `${color[key][i]}-${color[key][i + 1]}`;
if (!seenPairs.has(pairKey)) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm a bit worried about this approach, looks a lot like you're fixing the symptom and not the problem itself. Are the pair/value duplicated in layer.parameters?.color?

Copy link
Member Author

Choose a reason for hiding this comment

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

Are the pair/value duplicated in layer.parameters?.color?

No, they were duplicating in this method only as in #672, I changed from switch case using a condition to a for loop using a list iterating for both ['fill-color', 'circle-fill-color'] resulting in duplication

Copy link
Member

Choose a reason for hiding this comment

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

In which case do we have that pairKey already there? It's when you have a duplication in layer.parameters?.color, right? That's what I understand from the code at least.

Copy link
Member Author

Choose a reason for hiding this comment

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

We have that pairKey already there during the second iteration of for loop for 'circle-fill-color' after the first iteration of for loop for 'fill-color'

I cannot see the duplication in layer.parameters?.color

Copy link
Member

Choose a reason for hiding this comment

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

Ok got it!

I'm wondering how much we could simplify the schema itself to only have color steps and radius steps, not dealing with open-layers implementation details about circle-fill-color and fill-color at all in the schema.

Not part of this PR though. Thanks!

Copy link
Member

@martinRenou martinRenou May 14, 2025

Choose a reason for hiding this comment

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

I'm wondering how much we could simplify the schema itself to only have color steps and radius steps, not dealing with open-layers implementation details about circle-fill-color and fill-color at all in the schema.

If we do this, the schema would be closer to what we see in the Symbology panel, and this code would be simplified quite a lot and more robust.

Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

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

Thanks! let's track my concerns in an issue

@martinRenou martinRenou merged commit 62bbee1 into geojupyter:main May 14, 2025
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symbology panel: color steps are duplicated when reopening the panel
3 participants