The Darwin's Home Page Banner offers a visual reprentation for a current topic trending keywords and clusters by geoloc. The data is generated by our KeywordMeme™ API.
Sample Query url: http://darwintrend.herokuapp.com/trends.json which auto geolocates and serves trends keywords.
Here is a single trend item example:
{
_id: "5551cec2b61f8703000eb808",
tag: "Lio",
country: 16,
created_at: "2015-05-12T09:58:26.843Z",
apiKeywords: [
{
term: "carlo",
weight: 100
},
{
term: "cocodrills",
weight: 8
},
{
term: "free",
weight: 8
},
{
term: "noir",
weight: 7
},
{
term: "special",
weight: 7
}
],
__v: 0
}
The country code mapping can be found at : https://github.com/felginep/hawttrends/blob/master/HawtTrends/Controller/HTTermsDownloader.m
The app uses Telize to locate your country code, then uses it to query the trends for visualization,
You can request the trends for a specific country either by its country code number or abbreviation:
http://darwintrend.herokuapp.com/trends/1 or darwintrend.herokuapp.com/trends/US will achieve the same result.
For development:
npm install
gulp
Then run in another terminal
node index.js
The app leverages PIXIjs WebGL Canvas and [GSAP TweenMax](https://greensock.com/gsap).
Pixi Library was tweaked to achieve good circles.
var segs = Math.ceil(Math.abs(sweep) / (Math.PI * 2)) * 600;
PIXIjs uses only a low segments number to draw an arc, which makes the converting into graphics looking weird (pixellised circle) Upping the segments variable allows to refine the shape to look like an actual circle.
Demo available at : http://darwinbanner.herokuapp.com
For debugging purposes you can skip the loading animation by adding a sample data and initializing the app yourself:
Add <script src="/sampleData.js"></script>
to the index.ntl scripts list.
Replace the lines
//Setting up new app
app = new App();
//Fetching datas
app.fetchDatas();
with
app = new App();
$('.loader').hide();
app.setup();
## Darwin Banner License #### Copyright (c) 2015 Darwin Ecosystem LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Darwin Banner by Darwin Ecosystem LLC is licensed under a Creative Commons Attribution 4.0 International License.
Based on a work at https://github.com/DarwinEcosystem/darwinbanner.