Code Monkey home page Code Monkey logo

Comments (10)

dabeng avatar dabeng commented on May 22, 2024

Wow, so awesome use case!Give me some moments to comprehand your scenario

from orgchart.

reappergrimd avatar reappergrimd commented on May 22, 2024

Sorry was in a hurry when i posted this ;) it is a interesting use case that i have spent quite a bit of time on myself.

As i don't have a clear vision of where you intend to take your project in the future i did not feel i should be the one to make changes that would ultimately change your library to only fit my needs.

The code above forms part of a database call via json return that i use to populate not a org chart as much but a node based diagram for my wireless systems performance at home( i can see the activity on my nodes in the house ... looks cool haha)

from orgchart.

dabeng avatar dabeng commented on May 22, 2024

Sorry @reappergrimd , going through all your code snippets and descriptions, I still can't get your point. I guess that maybe you just want embed svg into the nodes of orgchart, right?

from orgchart.

reappergrimd avatar reappergrimd commented on May 22, 2024

Morning , Basically yes , the code works perfectly in a chrome environment and the svg is embedded but not in IE.

from orgchart.

dabeng avatar dabeng commented on May 22, 2024

Hi @reappergrimd , is the following picture what you want?
screenshot from 2016-08-03 09-37-25

from orgchart.

reappergrimd avatar reappergrimd commented on May 22, 2024

Hi , sorry for the delay. in essence that is exactly the view i would like in IE.
"It's like you can read my mind :) )

from orgchart.

dabeng avatar dabeng commented on May 22, 2024

Hello.In fact, through my testing , I got the similar snapshot in IE 9/10/11, just there is a bit difference in fonts.
2016-08-05_6-00-09

from orgchart.

reappergrimd avatar reappergrimd commented on May 22, 2024

Would you mind sharing your code you used to accomplish this, i want to make sure i haven't messed up somewhere :)

from orgchart.

dabeng avatar dabeng commented on May 22, 2024

I just append the img composed of svg to the root node.

    $('#chart-container').orgchart({
      'data' : datascource,
      'depth': 2,
      'nodeContent': 'title'
    });

    var data = '<svg width="400px" height="200px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
      '<title> designation</title>' +
      '<g id="columnGroup">' +
      '<rect x="65" y="10" width="75" height="110" fill="gainsboro"/>' +
      ' <text x="0" y="30" font-size="18px" font-weight="bold" fill="crimson">' +
      '<tspan x="0" dy="1.5em"> test 0 </tspan>' +
      '<tspan x="0" dy="1em"> test 1 </tspan>' +
      '<tspan x="0" dy="1em"> test 2</tspan>' +
      '</text>' +
      '<text x="250" y="30" font-size="18px" text-anchor="middle">' +
      '<tspan x="250" font-weight="bold" fill="crimson">Actual</tspan>' +
      '<tspan x="250" dy="1.5em"> 7 </tspan>' +
      '<tspan x="250" dy="1em"> 8 </tspan>' +
      '<tspan x="250" dy="1em"> 3 </tspan>' +
      '</text>' +
      '<text x="350" y="30" font-size="18px" text-anchor="middle">' +
      '<tspan x="350" font-weight="bold" fill="crimson">Plan</tspan>' +
      '<tspan x="350" dy="1.5em"> 8 </tspan>' +
      '<tspan x="350" dy="1em"> 8 </tspan>' +
       '<tspan x="350" dy="1em"> 2 </tspan>' +
      '</text>' +
      '</g>' +
      '</svg>';

      var img = new Image();
      var DOMURL = window.URL || window.webkitURL || self;
      var svg = new Blob([data], { type: 'image/svg+xml;charset=utf-8' });
      var url = DOMURL.createObjectURL(svg);
      var img = document.createElement("img");
      img.src = url;
      img.height = 130;
      $('.content:first').html(img);

from orgchart.

dabeng avatar dabeng commented on May 22, 2024

In fact, I am also interested to know why you build up common table with svg rather than

, ,

from orgchart.

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.