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

Can I make the Textbox collapsible to fill it with more description? #130

Open
altmandian opened this issue Feb 22, 2022 · 1 comment
Open

Comments

@altmandian
Copy link

altmandian commented Feb 22, 2022

I want the Nodeboxes to fill more words for the description, including a link to folow maybe. How can I make the boxes fit the content?

I know, that the function to fill the Textbox is:

// D3Plus Textbox with resizing capability
        var d3PlusBodyTextBox = new d3PlusTextBox()
            .select(element) // Sets the D3Plus code to append to the specified DOM element.
            .data(singledOutData)
            .text((data, index, arr) => {
                return self.getBodyDisplayText.call(self, data);
            })
            .textAnchor("middle")
            .verticalAlign("middle")
            .fontSize(13) // in pixels
            .x(nodeBodyBoxPadding.left)
            .y(recalculatedPaddingTop - nodeBodyBoxHeight / 2)
            .width(nodeBodyBoxWidth - nodeBodyBoxPadding.left - nodeBodyBoxPadding.right)
            .height(nodeBodyBoxHeight - recalculatedPaddingTop - nodeBodyBoxPadding.bottom)
            .ellipsis((text, line) => {
                // If text was cut-off, add tooltip
                selection.append("title")
                    .text(self.getBodyDisplayText(data));
                return ((text.replace(/\.|,$/g, "")) + "...");
            })
            .render();
    });

I am not sure, how to change it, so it will would fit my content inside the, or the box is spread out by the lenght of my conten. It would be great to know how to do that.

Thank you :)

te

@RyanB1303
Copy link

maybe you can enlarge the box like this

const treePlugin = new mitchTree.boxedTree()
.setData(fetchedData)
.setElement(target_element)
.getNodeSettings()
.setSizingMode('nodeSize')
.setBodyBoxWidth(300)
.back()
.initialize()

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

No branches or pull requests

2 participants