update js

This commit is contained in:
tangjiang 2019-12-19 16:46:52 +08:00
parent 7b2fd58c49
commit 5c87853852
2 changed files with 55 additions and 36 deletions

View File

@ -665,36 +665,43 @@ myChart.setOption(option);
myChart.on('brushselected', renderBrushed); myChart.on('brushselected', renderBrushed);
// myChart.on('focusnodeadjacency', renderFocusNodeJacency); // myChart.on('focusnodeadjacency', renderFocusNodeJacency);
myChart.on('click', function (params) { myChart.on('click', function (params) {
$('.fixed-left').css({left: 0}).addClass('collpased'); console.log('init方法===》》》', window.initial);
// $('.screen-btn').css({left: '360px'}); var name = params.name;
if (!$('.fixed-left').hasClass('active')) { console.log(name);
$('.screen-btn').css({left: '360px'}); // window.loadData && window.loadData(name);
} console.log(window.myChartGraph)
$('.collpase-icon').addClass('icon-shouqi').removeClass('icon-zhankai'); // window.myChartGraph && window.myChartGraph.restore && window.myChartGraph.restore();
const {seriesId, seriesIndex, seriesName, dataIndex, data, value } = params; window.initial && window.initial(name);
myChart.dispatchAction({ $('.fixed-left').css({left: 0}).addClass('collpased');
type: 'focusNodeAdjacency', // $('.screen-btn').css({left: '360px'});
seriesId, if (!$('.fixed-left').hasClass('active')) {
seriesIndex, $('.screen-btn').css({left: '360px'});
seriesName,
// 使用 dataIndex 来定位节点。
dataIndex,
});
const count = params.data[params.data.length - 1];
this.setOption({
yAxis: {
data: data
},
xAxis: {
axisLabel: {show: !!count}
},
title: {
id: 'statistic',
text: count ? '平均: ' + (1000 / count).toFixed(4) : ''
},
series: {
id: 'bar',
data: name
} }
}); $('.collpase-icon').addClass('icon-shouqi').removeClass('icon-zhankai');
const {seriesId, seriesIndex, seriesName, dataIndex, data, value } = params;
myChart.dispatchAction({
type: 'focusNodeAdjacency',
seriesId,
seriesIndex,
seriesName,
// 使用 dataIndex 来定位节点。
dataIndex,
});
const count = (params.data && params.data[params.data.length - 1]) || 0;
this.setOption({
yAxis: {
data: data
},
xAxis: {
axisLabel: {show: !!count}
},
title: {
id: 'statistic',
text: count ? '平均: ' + (1000 / count).toFixed(4) : ''
},
series: {
id: 'bar',
data: name
}
});
}); });

View File

@ -129,9 +129,6 @@
<script type="text/javascript" src="./js/jQuery-1.8.3.min.js"></script> <script type="text/javascript" src="./js/jQuery-1.8.3.min.js"></script>
<script type="text/javascript" src="./js/jquery.easy_slides.js"></script> <script type="text/javascript" src="./js/jquery.easy_slides.js"></script>
<script type="text/javascript" src="./js/demo.js"></script> <script type="text/javascript" src="./js/demo.js"></script>
<script src="./js/map.js"></script>
<script> <script>
$(document).ready(function () { $(document).ready(function () {
var graphContainer = document.getElementById('mainGraph'); var graphContainer = document.getElementById('mainGraph');
@ -376,6 +373,15 @@
alert("nothing") alert("nothing")
return 0 return 0
} }
graphList = {"keyword":{
"nodes":[],
"links":[]
}}
currentGraph = {
nodes: {},
links: {},
};
category = 1;
fillInfo(result, name) fillInfo(result, name)
nodeMap = {}; nodeMap = {};
graph = graphList.keyword graph = graphList.keyword
@ -405,11 +411,15 @@
} }
redrawGraph(); redrawGraph();
loadVideo('西藏'); loadVideo(name);
// myChartGraph.resize();
} }
init("西藏") init("西藏")
window.loadData = loadData;
window.initial = init;
window.myChartGraph = myChartGraph;
myChartGraph.on('click', function(params) { myChartGraph.on('click', function(params) {
if (params.dataType === "node") { if (params.dataType === "node") {
const node = nodeMap[params.data.name]; const node = nodeMap[params.data.name];
@ -471,6 +481,7 @@
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
// window.init = init;
$(document).ready(function () { $(document).ready(function () {
$('.slider_one_big_picture').EasySlides({ $('.slider_one_big_picture').EasySlides({
'autoplay': true, 'autoplay': true,
@ -568,7 +579,6 @@
// }) // })
}); });
</script> </script>
<script> <script>
$(function(){ $(function(){
$(".show_detail").hover(function(){ $(".show_detail").hover(function(){
@ -596,5 +606,7 @@
$(".voicePanel").removeClass("active"); $(".voicePanel").removeClass("active");
} }
</script> </script>
<script src="./js/map.js"></script>
</body> </body>
</html> </html>