mirror of
https://github.com/EDCD/EDDN.git
synced 2025-04-26 13:12:13 +03:00
Merge pull request #54 from Marginal/schema_stats
Tidy up display of new schemas
This commit is contained in:
commit
965e2d6ae0
@ -116,6 +116,10 @@
|
|||||||
var finishedslug = slugcontent_hyphens.replace(/[^a-zA-Z0-9\-]/g,'');
|
var finishedslug = slugcontent_hyphens.replace(/[^a-zA-Z0-9\-]/g,'');
|
||||||
return finishedslug.toLowerCase();
|
return finishedslug.toLowerCase();
|
||||||
}
|
}
|
||||||
|
makeName = function(str) {
|
||||||
|
var match = /^http:\/\/schemas.elite-markets.net\/eddn\/(\w)(\w*)\/(\d+)$/.exec(str);
|
||||||
|
return match ? match[1].toUpperCase() + match[2] + " v" + match[3] : str;
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
var monitorEndPoint = 'http://eddn-monitor.ed-td.space:9091/';
|
var monitorEndPoint = 'http://eddn-monitor.ed-td.space:9091/';
|
||||||
@ -215,104 +219,36 @@
|
|||||||
if(schema.substr(schema.length - 4) == 'test')
|
if(schema.substr(schema.length - 4) == 'test')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(makeSlug(schema) == 'httpschemaselite-marketsneteddncommodity1')
|
var slug = makeSlug(schema);
|
||||||
return;
|
var name = makeName(schema);
|
||||||
|
|
||||||
// Check series exists
|
// Check series exists
|
||||||
if(!chart.get(makeSlug(schema)))
|
if(!chart.get(slug))
|
||||||
{
|
{
|
||||||
// Format name
|
|
||||||
if(makeSlug(schema) == 'httpschemaselite-marketsneteddncommodity1')
|
|
||||||
name = 'Commodity v1';
|
|
||||||
else if(makeSlug(schema) == 'httpschemaselite-marketsneteddncommodity2')
|
|
||||||
name = 'Commodity v2';
|
|
||||||
else if(makeSlug(schema) == 'httpschemaselite-marketsneteddnshipyard1')
|
|
||||||
name = 'Shipyard v1';
|
|
||||||
else if(makeSlug(schema) == 'httpschemaselite-marketsneteddnoutfitting1')
|
|
||||||
name = 'Outfitting v1';
|
|
||||||
else
|
|
||||||
name = schema;
|
|
||||||
|
|
||||||
chart.addSeries({
|
chart.addSeries({
|
||||||
id: makeSlug(schema),
|
id: slug,
|
||||||
name: name,
|
|
||||||
data: []
|
|
||||||
});
|
|
||||||
/*
|
|
||||||
if(name == 'Commodity v2')
|
|
||||||
chart.addSeries({
|
|
||||||
id: makeSlug(schema + '(Projected)'),
|
|
||||||
name: name + ' (Projected * 55.0287)',
|
|
||||||
data: []
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add data
|
|
||||||
serie = chart.get(makeSlug(schema));
|
|
||||||
|
|
||||||
serie.addPoint({x: date, y: parseInt(hits)}, false);
|
|
||||||
|
|
||||||
// Add projected
|
|
||||||
/*
|
|
||||||
if(makeSlug(schema) == 'httpschemaselite-marketsneteddncommodity2')
|
|
||||||
{
|
|
||||||
serie = chart.get(makeSlug(schema + '(Projected)'));
|
|
||||||
serie.addPoint({x: date, y: Math.round(parseInt(hits)*55.0287)}, false);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Check series exists
|
|
||||||
if(!chartStacked.get(makeSlug(schema)))
|
|
||||||
{
|
|
||||||
// Format name
|
|
||||||
if(makeSlug(schema) == 'httpschemaselite-marketsneteddncommodity1')
|
|
||||||
name = 'Commodity v1';
|
|
||||||
else if(makeSlug(schema) == 'httpschemaselite-marketsneteddncommodity2')
|
|
||||||
name = 'Commodity v2';
|
|
||||||
else if(makeSlug(schema) == 'httpschemaselite-marketsneteddnshipyard1')
|
|
||||||
name = 'Shipyard v1';
|
|
||||||
else if(makeSlug(schema) == 'httpschemaselite-marketsneteddnoutfitting1')
|
|
||||||
name = 'Outfitting v1';
|
|
||||||
else
|
|
||||||
name = schema;
|
|
||||||
|
|
||||||
/*
|
|
||||||
if(name == 'Commodity v2' && !chartStacked.get(makeSlug(schema + '(Projected)')))
|
|
||||||
chartStacked.addSeries({
|
|
||||||
id: makeSlug(schema + '(Projected)'),
|
|
||||||
name: name + ' (Projected * 55.0287)',
|
|
||||||
data: []
|
|
||||||
});
|
|
||||||
else
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
//if(name != 'Commodity v2')
|
|
||||||
chartStacked.addSeries({
|
|
||||||
id: makeSlug(schema),
|
|
||||||
name: name,
|
name: name,
|
||||||
data: []
|
data: []
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Add projected
|
|
||||||
/*
|
|
||||||
if(makeSlug(schema) == 'httpschemaselite-marketsneteddncommodity2')
|
|
||||||
{
|
|
||||||
serie = chartStacked.get(makeSlug(schema + '(Projected)'));
|
|
||||||
serie.addPoint({x: date, y: Math.round(parseInt(hits)*55.0287)}, false);
|
|
||||||
}
|
|
||||||
// Add data
|
// Add data
|
||||||
else
|
serie = chart.get(slug);
|
||||||
*/
|
|
||||||
{
|
|
||||||
serie = chartStacked.get(makeSlug(schema));
|
|
||||||
|
|
||||||
serie.addPoint({x: date, y: parseInt(hits)}, false);
|
serie.addPoint({x: date, y: parseInt(hits)}, false);
|
||||||
|
|
||||||
|
// Check series exists
|
||||||
|
if(!chartStacked.get(slug))
|
||||||
|
{
|
||||||
|
chartStacked.addSeries({
|
||||||
|
id: slug,
|
||||||
|
name: name,
|
||||||
|
data: []
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add data
|
||||||
|
serie = chartStacked.get(slug);
|
||||||
|
serie.addPoint({x: date, y: parseInt(hits)}, false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user