Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

feat: added the ability to set the size of an icon when using a dot s… #4220

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jamespcole
Copy link

This is a small change allowing the icon size to be scaled relative to the node when using the dot shape.

The existing "icon.size" property is ignored when using a "dot" shape so this new option is intended to enable specifying the icon size relative to the shape size.

To use this a "scale" setting can be added to the icon settings:


{
    shape: 'dot',
    size: 30,
    icon: {
        face: 'FontAwesome',
        color: '#2B7CE9',
        scale: 0.9,
    }
}

Thank you for contributing to vis.js!!

Please make sure to check the following requirements before creating a pull request:

  • All pull requests must be to the develop branch. Pull requests to the master branch will be closed!
  • Make sure your changes are based on the latest version of the develop branch. (Use e.g. git fetch && git rebase origin develop to update your feature branch).
  • Provide an additional or update an example to demonstrate your changes or new features.
  • Update the documentation if you introduced new behavior or changed existing behavior.
  • Reference issue numbers of issues that your pull request addresses. (If you write something like fixes #1781 in your git commit message this issue gets closed automatically by merging your pull request).
  • Expect review comments and change requests by reviewer.
  • Delete this checklist from your pull request.

@exoego
Copy link

exoego commented Jan 10, 2019

Code is LGTM.

It would increase a chance to get merged if new option is added to

Copy link
Member

@mojoaxel mojoaxel left a comment

Choose a reason for hiding this comment

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

@jamespcole Thanks! But I have some questions:

  • There is already a icon.size option. Is this not enough?
  • Every new option needs to be documented in the docs as well. somewhere near here
  • If you still think this feature is needed could you please extend the icons example

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants