diff --git a/chart/README.md b/chart/README.md new file mode 100644 index 0000000..b2c8720 --- /dev/null +++ b/chart/README.md @@ -0,0 +1,18 @@ +Dual-scale-D3-Bar-Chart +======================== + +This is a demo for creating dual-scaled bar charts using D3.js + +I came across this task when I was working on a simple HTML project. As I googled around and, unfortunately, could not find any example, I decided to do it myself. + +Please bear in mind that I am new to D3.js and this is actually my first time using it. I had heard of D3.js but never used it. + +Hope that this could be of use to someone. All suggestions for improvement are welcome. + +Note: since d3.js uses ajax to load tsv files, the files contained in the src folder cannot be run in a browser using file:///. Execute the following command under the src directory to create a HTTP server. + + python -m SimpleHTTPServer + +Use the following URL to access index.html + + http://localhost:8000/index.html diff --git a/chart/preview/host-lookup-chart.png b/chart/preview/host-lookup-chart.png new file mode 100755 index 0000000..832b363 Binary files /dev/null and b/chart/preview/host-lookup-chart.png differ diff --git a/chart/src/data.tsv b/chart/src/data.tsv new file mode 100644 index 0000000..83d02fc --- /dev/null +++ b/chart/src/data.tsv @@ -0,0 +1,9 @@ +approach memHit timeHit memMiss timeMiss +hosts-reversed-binary 109 3704594 96 602820 +hosts-binary 351 3718253 210 605188 +hosts-plain-switch 367 2874843 88 607200 +hosts-hash 347 5062512 207 609278 +hosts-switch 88 894410 77 614169 +ips-switch 37 1348111 72 597439 +ips-indexOf 35 4853437 72 599850 +ips-binary 31 3542401 77 602958 diff --git a/chart/src/index.html b/chart/src/index.html new file mode 100644 index 0000000..9bde53c --- /dev/null +++ b/chart/src/index.html @@ -0,0 +1,181 @@ + + + + + + \ No newline at end of file