stjaenicke / TagPies

4 stars 1 forks source link

Issue with examples #1

Open idea-launch-lab opened 8 years ago

idea-launch-lab commented 8 years ago

Hi Stefan, First off, great visualization tool and thanks for sharing!

I downloaded the repo and found that the example didn't run right out-of-box. Below is my modified version that I was able to run on my local desktop machine.

<!DOCTYPE html>
<html lang="en">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<title>eXChange - Comparing co-occurrences with TagPies</title>

<head>
    <script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="./lib/d3.v3.min.js">></script>
    <script src="./d3.layout.cloud.tagpies.js"></script>
    <script src="./TagPie.js"></script>
    <link   href="./tagpies.css" rel="stylesheet" type="text/css"/>
    <script src="./examples/aeger.js"></script>
    <script>
        $(document).ready (function () {
            var tagPie = new TagPie (
                'TagPieContainerDiv', 
                aeger, 
                {
                    style: "bars",
                    font: "Arial",
                    number_of_tags: 750,
                    edit_distance: 0,
                    colors: [ "red", "blue", "green" ]
                }
            );
        });
    </script>
</head>
<body>
    <h2>Hello World!</h2>
    <div id="TagPieContainerDiv" style="background: #fff; width: 800px; height: 800px;"></div>
</body>
</html>

Again, thanks for sharing, and I look fwd to evaluating the visualization.

idea-launch-lab commented 8 years ago

I do have an issue, now that I have tried to integrate TagPies with my code (which uses canvas to draw images).

Specifically, the following lines towards end of d3.layout.cloud.tagpies.js somehow interfere with drawing of the other canvas context and I cannot see images in a different canvas. If I comment out those lines then I am able to render images the different canvas. Is there a way to isolate the fill/stroke/textAlign settings?

//d3.layout.cloud.tagpies.js

  c.fillStyle = c.strokeStyle = "red";
  c.textAlign = "center";

Thanks. Sid

stjaenicke commented 8 years ago

Hi Sid,

the first one should not be an issue. I downloaded the zip & loaded the exchange.html from the file system without errors... your version works from the TagPies root folder.

Best, Stefan.

stjaenicke commented 8 years ago

Hi again,

I once put multiple TagPies on one screen without problems, which means it is able to deal with multiple canvas instances. So, it should not interfere with your code. Maybe the problem is on your side??? Unfortunately, you cannot isolate these lines.

Best, Stefan.

stjaenicke commented 8 years ago

Sid,

if you use the TagPies for your project or data I would like you to send me some information. I would like to put TagPies use cases on the TagPies homepage.

Thanks in advance, Stefan.

idea-launch-lab commented 8 years ago

@stjaenicke Thanks for your responses and clarifications, Stefan. I have been able to integrate TagPies into my project and will be happy to share details in a bit. Briefly, I plan on using it as a tool to explore similarity/dissimilarity among a small set of scholarly articles that share a common topic. I think TP will nicely complement a similarity graph of documents that I create using the standard tf-idf / cosine similarity technique.

I made a slight rendering/stylistic modification to highlight the shared words/terms. I render the words with multiplicity <=1 with lower opacity, so words that overlap over one or more documents pop in the tag cloud. I like the bars that show relative distribution of words and look fwd to reading your article/future work on evaluating usability/effectiveness of the overall technique.

idea-launch-lab commented 8 years ago

Hi again, Re. the issue with canvas context, would it matter if instead of globally exporting the tag cloud functionality I wrap it up a self-contained namespace? Thanks.

idea-launch-lab commented 8 years ago

TagPies with varying opacity to highlight terms that are shared with one or more document corpus.

tagpies