Code Monkey home page Code Monkey logo

Comments (9)

David-Desmaisons avatar David-Desmaisons commented on May 22, 2024 2

Last try:

<div id="container">
<tree :data="tree" :node-text="name" layoutType="circular" class="tree">
<\div>
.tree {
    width: 100%;
    height: 100%;
}
.container{
    width: 500px;
    height: 500px;;
}

If this does not solve, I don't have time to clone your repo and check it, so you will have to share a live demo if you want me to look at it.

from vue.d3.tree.

David-Desmaisons avatar David-Desmaisons commented on May 22, 2024

Hello @Wenzel , your component should have a weither a height or max-height and weither a width or max-width.

from vue.d3.tree.

David-Desmaisons avatar David-Desmaisons commented on May 22, 2024

I just update the documentation with this restriction.

from vue.d3.tree.

Wenzel avatar Wenzel commented on May 22, 2024

Hi @David-Desmaisons ,
thank you for quickly looking at my issue and updating the documentation.

I tried again by setting a parent <div id="vued3tree">, and assigning it an height and width:
https://github.com/Wenzel/bug_vued3tree/blob/master/src/components/HelloWorld.vue#L33

But it still doesn't work.
You can see that the CSS is applied:
screenshot from 2018-08-08 13-08-38
And the size keeps increasing:
screenshot from 2018-08-08 13-09-22

I don't understand what i'm doing wrong here ?
I created a repo for you to reproduce the issue:
https://github.com/Wenzel/bug_vued3tree

It's a simple vuejs project with webpack.
the tree is initialized in the HelloWorld.vue component.

Thank you for your time.

from vue.d3.tree.

David-Desmaisons avatar David-Desmaisons commented on May 22, 2024

Assign width:100% and height:100% to the tree component

from vue.d3.tree.

Wenzel avatar Wenzel commented on May 22, 2024

I tried multiple things:
setting the size on the tree class:

.tree {
    width: 100%;
    height: 100%;
}

doesn't work

setting it on the svg generated HTML element:

svg {
    width: 100%;
    height: 100%;
}

same result

How do select the <tree> component with a CSS selector, as it doesn't exist when the HTML is generated, and the content is replaced by a <svg> element ?

I'm sorry for my lack of skills in VueJS and CSS, totally new to both of them.

Thanks.

from vue.d3.tree.

David-Desmaisons avatar David-Desmaisons commented on May 22, 2024

Use:

<tree :data="tree" :node-text="name" layoutType="circular" class="tree">
.tree {
    width: 100%;
    height: 100%;
}

If this not resolves the problem, create a webpackbin or something similar so I can check,thanks

from vue.d3.tree.

Wenzel avatar Wenzel commented on May 22, 2024

It didn't solve my problem:
screenshot from 2018-08-08 17-01-49

create a webpackbin or something similar so I can check,thanks

I created a dedicated repo on Github: https://github.com/Wenzel/bug_vued3tree
all you have to do is clone, npm install and npm run dev
Is that okay ?
I'm not familiar with webpackbin :/

Thank you.

from vue.d3.tree.

Wenzel avatar Wenzel commented on May 22, 2024

It worked !
thank you for your time @David-Desmaisons.

from vue.d3.tree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.