npm install -g grunt-cli
npm install
grunt server
for live developmentgrunt build
for building styles and concatenating scriptsA demo with dummy data.
JSON object represents a tree with keys: year -> month -> entity key -> (title & occurences)
{
"2009": {
"1": {
"key1":{"name":"V. Ciobanu","occurences":99.9999},
"key2":{"name":"L. Ciobanu","occurences":115},
"key3":{"name":"D. Ungureanu","occurences":2},
"key4":{"name":"S. Deleanu","occurences":63}
},
"2": {
"key1":{"name":"V. Ciobanu","occurences":23},
"key2":{"name":"L. Ciobanu","occurences":53},
"key3":{"name":"D. Ungureanu","occurences":7},
"key4":{"name":"S. Deleanu","occurences":34}
}
}
Each entity should use only one unique key and the same name. Years and months should be consistent (no gaps). Same entities should be used for all months (even if an entity has a 0 occurences value).
To initialize visualization it is enough to load styles, script and run
$(function () {
$('#container').words_mentions()
});
By default data will be searched at data/dataset.json
uri. You may change it by passing a configuration object to plugin initialization method:
$(function () {
$('#container').words_mentions({
data_source: 'data/dataset.json'
})
});
You may find all default configuration settings at the end of the plugin.
To set entities pictures set images
configuration value:
$(function () {
$('#container').words_mentions({
data_source: 'data/dataset.json',
images: {
"V. Ciobanu": 'images/1.jpg',
"L. Ciobanu": 'images/2.jpg',
"D. Ungureanu": 'images/3.jpg',
"S. Deleanu": 'images/4.jpg'
}
})
});