tagpies's People
Forkers
mossavatfontystagpies's Issues
Issue with examples
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.
- Sid
Error while building hash map in TagPies.js for certain key terms
While testing TagPies with a document corpus I found that building the hash map prioHash
in TagPies.js
file can have issues when word.key
conflicts with JavaScript standard attributes for Array object.
In code below when word.key = "length"
or one of the other JS attributes for arrays (like 'map', 'slice', etc.) then the line if(typeof prioHash[word.key] == "undefined")
returns false even though the key is not present in prioHash, resulting in error in the subsequent line prioHash[word.key].push(word);
My first and rather basic solution is to create a list of possible conflict terms and catch them before testing the hash map. I modify the terms by adding a space at end to avoid the conflict.
// var problemTerms = ['length', 'map', 'filter', 'slice', 'sort'];
for(var i = 0; i < tags1.length; i++) {
var word = tags1[i];
globalHash[word.id] = word;
//if (problemTerms.indexOf (word.key) > -1) {
// word.key += ' ';
// //console.log ("!!! problem term: " + word.key);
//}
if(typeof prioHash[word.key] == "undefined") {
prioHash[word.key] = [];
freqHash[word.key] = 0;
}
prioHash[word.key].push(word); // Error here if word.key is one from problemTerms
freqHash[word.key] += word.value;
if(word.value > maxFreq) {
maxFreq = word.value;
}
if(word.value < minFreq) {
minFreq = word.value;
}
}
Thanks.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.