Thanks to visit codestin.com
Credit goes to github.com

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

Conversation

@eymiha
Copy link
Contributor

@eymiha eymiha commented Nov 30, 2016

(This replaces PR #2362, adding functionality for width and height constraints)

fixes #1603
fixes #1628
fixes #1936
fixes #2298
fixes #2384

Adds multifont rendering capability to network node and edge labels. Existing networks are not altered.

font.multi designates html or markdown. Bold, italic and code (monospaced) markup is supported.

font.bold designates the bold font properties, font.italic the italic font properties, font.bolditalic the bold-italic font properties, and font.mono the monospace font properties.

A vadjust property has also been added to the fonts that may be used to adjust any baseline mismatching between fonts.

The network/labels/labelMultifont.html example provides illustration and some finer details.


Adds minimum and maximum widths for nodes, maximum widths for edges, and minimum height and vertical label alignment for nodes. Existing networks are not altered.

Maximum width settings will break label lines on spaces to fit. Minimum width (and height) settings will expand the label horizontally (or vertically) to reach the minimum.

If the node is expanded vertically, the vertical alignment option will push it to the top, middle or bottom of the unfilled space.

The network/nodeStyles/widthHeight.html example provides illustration and some finer details.


Properties may be assigned in the network node and edge options, or on individual nodes and edges.

The documents are also updated.

@yotamberk
Copy link
Member

@eymiha Wow! this PR is huge! Thanks for the contribution!
I've just finished going over the previous PR. Are you planning to close the first one?

@eymiha
Copy link
Contributor Author

eymiha commented Nov 30, 2016

Yes, I just closed the first one. Sorry about the size, but I really need the functionality to move forward in some projects I was doing. It seems like the changes could benefit others as well.

Copy link
Member

@yotamberk yotamberk left a comment

Choose a reason for hiding this comment

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

Amazing! Great work! Thank you!!

@eymiha
Copy link
Contributor Author

eymiha commented Dec 1, 2016

While eating my dog food I found a few issues and made some corrections. They were mostly edge cases, but I hit them frequently enough to require some fixing.

@yotamberk
Copy link
Member

dog food?

@mojoaxel mojoaxel added this to the Minor Release v4.18 milestone Dec 2, 2016
@mojoaxel mojoaxel merged commit 8a9edbb into visjs:develop Dec 2, 2016
@mojoaxel
Copy link
Member

mojoaxel commented Dec 2, 2016

@eymiha Thanks again! Very clean and nice pull request!
I would prefer multiple smaller pull-requests next time ;-)

@eymiha
Copy link
Contributor Author

eymiha commented Dec 2, 2016

Indeed!

accessors = [accessors];
}
for (const member of pile) {
candidate = member[accessors[0]];
Copy link
Member

Choose a reason for hiding this comment

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

@eymiha It looks like this PR broke the develop branch.

member can be undefined. We need a check here:

if (!member) continue;

Copy link
Member

Choose a reason for hiding this comment

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

fixed with #2403

mojoaxel added a commit that referenced this pull request Dec 3, 2016
@mojoaxel mojoaxel modified the milestone: Minor Release v4.18 Dec 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants