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
feat(vtkscalarbaractor): adds generateTicks field to vtkScalarBarActor #2375
Conversation
Very nice MR! I suspect the failing test is due to font differences. We need to add another valid image (see testScalarBar.js for how to have multiple baselines) To get the image that failed you can go to actions at the top of this page and then click on your failed workflow and then download the tests artifact (zip file) and open that in a browser, click on the hide/show browser tests and the results should show up. If you get stuck just holler or check this page https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts The only other minor thing I see is since we are making tickstrings public let's change the capitalization to be tickStrings and getTickStrings() (tickstrings was my mistake, but let's fix it now if that's OK) |
@martinken Thanks - I'll add the images from the failing tests as you describe (I was wondering where the multiple baseline images came from!) then convert back to a reviewable PR. |
…teststrings to testStrings
…esetGenerateTicks function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@boucaud - I think this is ready to merge pending @martinken's review. |
🎉 This PR is included in version 24.11.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Context
I'd like to enable customizing ticks in vtkScalarBarActor to do things like the following:
Discussed approach with @martinken on Discourse thread here.
Results
The approach I took was to create a new
generateTicks
field that is implemented similarly toautoLayout
.I ended up adding
ticks
andtickstrings
setters / getters to thevtkScalarBarActorHelper
publicAPI
where those values had been private to thevtkScalarBarActorHelper
model previously. ThegenerateTicks
function then has to set those values. This is very similar to the current implementation ofautoLayout
, although probably could be improved.Here are results from my client app:
Setting a new
generateTicks
function requires the user to update thevtkScalarBarActor
annotations. This also seems to be true for other similar functions,setAxisLabel
for example. This is how I'm doing that:Changes
generateTicks
field tovtkScalarBarActor
PR and Code Checklist
npm run reformat
to have correctly formatted codeTesting
Adds new test testScalaBarSetGenerateTicks.js, tests against image testScalarBarSetGenerateTicks.png.
Funding
This contribution is funded by Pollination.