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

Add optional interpolation points to icon sets #269

Merged
merged 1 commit into from Oct 19, 2023

Conversation

kiskoza
Copy link
Member

@kiskoza kiskoza commented May 31, 2023

Description

Closes #221

I turned the code snippet from #221 into a PR.

I renamed the new attribute to interpolationPoints as the Cfvo class refers to them as interpolation points in the comments (then as val in the code).

I also had to move the call for initialize_value_objects into the to_xml_string method as we can override the interpolation points any time before the actual serialization. I'm not sure if we really need to store it in memory, it could be handy only if we call to_xml_string multiple times on the same iconSet.

Your checklist for this pull request

  • I have reviewed the guidelines for contributing to this repository.
  • I have added (or updated) appropriate tests if this PR fixes a bug or adds a feature.
  • If this PR doesn't need tests (docs change), I added [ci skip] to the title of the PR.
  • If this closes any issues, I have added "Closes #issue" to the PR description or my commit messages.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • I added an entry to the changelog.

def initialize_value_objects
@value_objects = SimpleTypedList.new Cfvo
@value_objects.concat [Cfvo.new(:type => :percent, :val => 0), Cfvo.new(:type => :percent, :val => 33), Cfvo.new(:type => :percent, :val => 67)]
@interpolationPoints.each { |point| @value_objects << Cfvo.new(type: :percent, val: point) }
Copy link
Contributor

@tagliala tagliala May 31, 2023

Choose a reason for hiding this comment

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

Hi, this should also fix a false positive in rubocop, can you please try to regenerate the config and check if the todo changes?

rubocop --auto-gen-config --no-auto-gen-timestamp --no-offense-counts

I expect that Style/ConcatArrayLiterals offence will be removed

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, I ran the rubocop and removed the todo from the list

@kiskoza kiskoza merged commit 57ddee5 into caxlsx:master Oct 19, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to set values for IconSet on add_conditional_formatting
2 participants