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

Component | Graph: Configurable node labels trimming #121

Merged
merged 7 commits into from
Feb 6, 2023

Conversation

rokotyan
Copy link
Contributor

@rokotyan rokotyan commented Jan 25, 2023

#120
image

  • Configurable trimming of node labels and sub-labels via new nodeLabelTrim and nodeSubLabelTrim config properties;
  • New dev app example
  • Updated docs: Screen Shot 2023-01-26 at 1 17 18 PM

@rokotyan rokotyan added the enhancement New feature or request label Jan 25, 2023
@rokotyan rokotyan added this to the Release v1.0.3 milestone Jan 25, 2023
@rokotyan rokotyan requested a review from reb-dev January 25, 2023 17:50
@@ -143,8 +143,12 @@ export interface GraphConfigInterface<N extends GraphInputNode, L extends GraphI
nodeIconSize?: NumericAccessor<N>;
/** Node label accessor function or constant value. Default: `node => node.label` */
nodeLabel?: StringAccessor<N>;
/** Defines whether to trim the node labels or not. Default: `true` */
nodeLabelTrim?: BooleanAccessor<N>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we support multiple trim types like we do with other components? i.e. make this a TrimMode accessor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@reb-dev We should, but I wanted to do it later along with overall refactoring of labels in the library. However, it can be a small change, I'll check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@reb-dev I've added additional properties to configure trimming and extended the example accordingly

image

image

Copy link
Collaborator

Choose a reason for hiding this comment

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

Great!

reb-dev
reb-dev previously approved these changes Feb 2, 2023
@rokotyan rokotyan merged commit 52e8cec into main Feb 6, 2023
@rokotyan rokotyan changed the title Graph: Configurable node labels trimming Component | Graph: Configurable node labels trimming Feb 15, 2023
@rokotyan rokotyan mentioned this pull request Feb 15, 2023
@rokotyan rokotyan deleted the feature/graph-labels-trimming branch May 22, 2023 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants