• forked:HighChart
Import an externally hosted application
Check style

  • JavaScript
  • CSS
  • HTML
  • Images
  • Input Data
  • ReadMe
  • forked:HighChart
  • jquery-1.7.1.min.js  
  • http://code.highcharts.com/highcharts.js  
  • http://code.highcharts.com/modules/exporting.js  
  •  
  • history

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
 
HighChart = function(containerId, options) {
    new Application.highChart(containerId, options);
};
 
if (Application === "undefined" || !Application) {
    var Application = {};
}
 
Application.highChart = function() {
    this._init.apply(this, arguments);
};
 
Application.highChart.prototype = {
    
    _containerId : null,
    _options : null,
    _workId : null,
    _fileName : null,
    _highChartContainerId : null,
    _appProperty : null,
    
    _default : {
        filterNamespace : "http://linkdata.org/",
        propertyFilterNamespace : "http://linkdata.org/property",
        propertyFilterExpression : "Expression",
        subjectUriPhrase : "http://atted.jp/data/locus/",
        subjectPPDBUriPhrase : "http://ppdb.agr.gifu-u.ac.jp/ppdb/cgi-bin/display.cgi?organism=At&gene=",
        selectSubjectClass : "selectSubject",
        drawArea : "drawArea"
    },
    
    _init : function(containerId, options) {
        this._containerId = containerId;
        this._options = $.extend({}, this._default, options);
        this._workId = this._options.workId;
        this._fileName = this._options.fileName;
        var date = new Date();
        this._highChartContainerId = "high_chart_" + date.getTime();
        this._initAppProperty(this._options);
        this._initView();
        this._initSelect();
    },
    
    _initAppProperty : function(opts) {
        var obj = {
            workId : opts.workId,
            fileName : opts.fileName
        };
        this._appProperty = new Application.motifProperty(obj);
    },
    
    _initView : function() {
        var self = this;
        var sb = [];
        sb[sb.length] = "<div class='row'>";
        sb[sb.length] = "<div class='label left'>Select Subject</div>";
        sb[sb.length] = "<div class='left'>";
        sb[sb.length] = "<select class='" + self._default.selectSubjectClass + "'>";
        sb[sb.length] = "<option value='" + -1 + "'>-- Select Subject --</option>";
        $.each(LinkData.getSubjects(self._workId, self._fileName), function(subKey, subValue) {
            var label = self._getLabel(subValue);
            sb[sb.length] = "<option value='" + subValue + "'>" + label + "</option>";
        });
        sb[sb.length] = "</select>";
        sb[sb.length] = "</div>";
        sb[sb.length] = "</div>";
        sb[sb.length] = "<div id='" + self._highChartContainerId + "'></div>";
        $("#" + this._containerId).append(sb.join(""));
    },
    
    _initSelect : function() {
        var self = this;
        $select = $("#" + self._containerId + " ." + self._default.selectSubjectClass);
        $select.change(function() {
            var subject = $("option:selected", this).val();
            var dataArray = self._getDataArray(self._workId, self._fileName, subject);
            var xCategory = self._getXCategory(self._workId, self._fileName, subject);
            self._drawChart(self._highChartContainerId, dataArray, xCategory);
        });
    },
    
    _getDataArray : function(workId, fileName, subject) {
        var self = this;
        var tripleList = LinkData.getTriplesBySubject(workId, fileName, subject);
        var dataArray = [];
        var dataObject = {};
        var array = [];
        var duplicateProperty = [];
        $.each (tripleList, function(tKey, tValue) {
            var property = tValue.property;
            if (property.indexOf(self._options.filterNamespace) == -1) {
                return;
            }
            if ($.inArray(property, duplicateProperty) > -1) {
                return;
            }
            if (property.indexOf(self._options.propertyFilterNamespace) == -1 || property.indexOf(self._options.propertyFilterExpression) > -1) {
                array.push(parseFloat(tValue.object));
                duplicateProperty.push(property);
            }
jquery-1.7.1.min.js
http://code.highcharts.com/highcharts.js
http://code.highcharts.com/modules/exporting.js
Playing...

jquery-1.7.1.min.js
http://code.highcharts.com/highcharts.js
http://code.highcharts.com/modules/exporting.js