Giter VIP home page Giter VIP logo

codeflower's People

Contributors

fzaninotto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codeflower's Issues

Issue opening and closing folder nodes with only a folder inside

It seems I have a small bug or misunderstanding of the specs.
Clicking on a folder node which only contains another folder node, I see a "free node" that is still displayed.
Before the clik
capture d ecran 2016-11-28 a 15 45 40
after the click
capture d ecran 2016-11-28 a 15 46 06
Is it a bug or is it part of the spec that would not allow folder node without leaf ?
It seems ok with folders containing two other folder nodes

Middle nodes not being shown

In my final diagram, not all nodes are shown and the final diagram shows the links starting from nowhere. However, if i collapse my first node then the middle nodes for the next two parent nodes appear, if i collapse second parent node, fourth one appears and so on. Unfortunately, not able to figure out the cause of the issue.

image

Unclear Data Type

On your webpage you mention about how the only things a web developer would need to do in order to implement your CodeFlower would be import CodeFlower.js and d3.js, create a div like so <div id="visualization"></div>, and to put the following code inside of script tags:
var myFlower = new CodeFlower("#visualization", 300, 200);
myFlower.update(jsonData);

I have done all of the following and even have a working .json file (I tested it on your webpage). My question is how would I tell myFlower to get info from my .json file? I already tried replacing 'jsonData' with a String address to my .json file and that did not work.
Thank you in advance!

Node background image

I'm trying to add a background image to nodes (svg:circle) with the pattern method mentionned here:
https://groups.google.com/forum/#!topic/d3-js/1P5IphE319g
or here http://stackoverflow.com/questions/19202450/adding-an-image-within-a-circle-object-in-d3-javascript

The DOM is OK, all seems alright, but no images. Someone can help me?

Here my code added to CodeFlower.js :

(...)
     // Enter any new nodes
    this.node.enter().append('defs')
        .append('pattern')
            .attr('id', function(d) { return (d.id+"-icon");}) // just create a unique id (id comes from the json)
            .attr('patternUnits', 'userSpaceOnUse')
            .attr('width', 32)
            .attr('height', 32)
            .append("svg:image")
                .attr("xlink:xlink:href", function(d) { return (d.icon);}) // "icon" is my image url. It comes from json too. The double xlink:xlink is a necessary hack (first "xlink:" is lost...).
                .attr("x", 0)
                .attr("y", 0)
                .attr("height", 32)
                .attr("width", 32)

    this.node.enter().append('svg:circle')
        .attr("class", "node")
        .classed('directory', function(d) { return (d._children || d.children) ? 1 : 0; })
        .attr("cx", 16)
        .attr("cy", 16)
        .attr("r", 16)
        .style("stroke", "black")
        .attr("fill", function(d) { return ("url(#"+d.id+"-icon)");})
        .call(this.force.drag)
        .on("click", this.click.bind(this))
        .on("mouseover", this.mouseover.bind(this))
        .on("mouseout", this.mouseout.bind(this));

(...)

Show folder labels

Hi
Question, how can I make visible all the folder labels permanently (now they are displayed only on mouseover).
thx

more complex flowers?

would be interesting to measure code in other ways than just LOC and allow these measures to affect both the size and color of flower petals. for example, metrics like:

  • methods per class
  • average lines per method
  • cyclomatic complexity
  • test coverage

rather than taking on all these things directly, perhaps codeflower could simply provide a slight extension to the json data format that allows integration with arbitrary tools by tagging values with metric type as well as value. For example { metric="loc" value="500" } or { metric="averageMethodLines" value="1.5" }. codeflower might have to perform some range scaling on values but other projects could handle the data extraction (it would be neat, btw, if that could be more seamless and automatic... ideally someone could add a codeflower to their git project that continuously updates all kinds of metrics in just a few minutes... perhaps codeflower should be integrated into github...).

i wonder if there might not be a kind of biology/morphology to codeflowers where you can recognize different "species" of projects using additional metrics like these...

convertFromClocToJSON() doesn't work if cloc.exe executed with "--by-file-by-lang" flag

I downloaded your dataConverter.js and I have used it in my code.
Everything works fine with

cloc.exe --by-file  ....

but when I generate cloc file

cloc.exe --by-file-by-lang ....

output cloc files can not be converted to JSON.

As result after cloc file is trying to be converted I have error

Uncaught TypeError: Cannot set property 'name' of undefined dataConverter.js

in console in 32-33 this line:
https://github.com/fzaninotto/CodeFlower/blob/master/javascripts/dataConverter.js#L32

json = getChildren(json)[0];
json.name = 'root';

Discs run away from the mouse

The instructions for CodeFlower say you can click on a directory to collapse it, but the directory dots "run away" from the mouse cursor. The only way to click on a directory node (which is roughly 1 pixel wide) is to "sneak up on it" and click before the animation can move it away. Doing so is nearly impossible, requiring dozens of attempts to nail down the slippery dot. It makes a good dexterity game but a frustrating interface.

I thought maybe this "run away" behavior was a feature, but I cannot think of any reason it would ever be useful.

index.html file is not showing code flower

Hi, I would love to use your code flower on my site but when I try to make my own the
<div id="visualization"></div> remains blank. I came across the same error when trying out your index.html file. I know this is not a rare file corruption issue because I downloaded and unzipped your code twice but came across the same problem.

Since I am contacting you now I suppose I can also tell you that the example CodeFlower() instance on your webpage says "myflower" instead of "myFlower". ;)

Lastly, is "jasonData" on the same page the String address to the .json file?

Thank you for helping!

  • Mark

CodeFlower works in Chrome but not in IE 9

Hello again.
I did some research and the consensus is that D3.js should work in IE9 and up. However, when I tried the CodeFlower in IE9 it gave me the following errors:

SCRIPT5009: 'CSSStyleDeclaration' is undefined
d3.js, line 7 character 3
SCRIPT5009: 'd3' is undefined
d3.geom.js, line 1 character 13
SCRIPT5009: 'd3' is undefined
d3.layout.js, line 1 character 13
SCRIPT5009: 'd3' is undefined
asdbsw01poc.fmr.com:801, line 144 character 7

Chrome did not have any errors.
I am wondering if this is purely a D3 thing or if any modifications could be made that would fix this problem. I would really like to make the diagram visible to those using IE. Perhaps an update of your D3 file would fix this issue?
Please help and thank you in advance.

  • Mark

Embed URL within a circle

Hi,
Does anyone know how to embed a url within a circle in codeflower so that when I do a mouse over and the url is visible I can click on it.

Is it something that I can embed in the following:

.call(this.force.drag)
.on("click", this.click.bind(this))
.on("mouseover", this.mouseover.bind(this))
.on("mouseout", this.mouseout.bind(this));

Thanks in advance.

Create an implementation guide

Hey @fzaninotto , I loved the idea of this visualization.
Just one request - can you create a simple step by step wiki page for implementing this?
I understand it's easy to do it just by Ctrl + U, however doing this will enhance the adoption of this project.

Code flower not working with latest d3 Version (3.4.11)

code flower not properly drawn with latest d3 version, and dependency wheel is not working with the version specified with code flower. Please help me in making both code flower and dependency wheel working in the same project.

Thanks in advance

How collapse nodes on start?

I would like collapse all nodes (or just some selected nodes if it's possible through a declaration in the json file for example) when the graph is loaded.

Unfortunatly, I have no idea how to do that...

converters fail with package/folder named 'language'

it looks like you can't have a package/folder named language or the conversion code fails (for both WC and CLOC conversions). i'm guessing this has something to do with the JS variable name 'language' but i don't know enough JS to know what's wrong or how to fix it.

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.