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('focusnodeadjacency', renderFocusNodeJacency);
myChart.on('click', function (params) {
$('.fixed-left').css({left: 0}).addClass('collpased');
// $('.screen-btn').css({left: '360px'});
if (!$('.fixed-left').hasClass('active')) {
$('.screen-btn').css({left: '360px'});
}
$('.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.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
console.log('init方法===》》》', window.initial);
var name = params.name;
console.log(name);
// window.loadData && window.loadData(name);
console.log(window.myChartGraph)
// window.myChartGraph && window.myChartGraph.restore && window.myChartGraph.restore();
window.initial && window.initial(name);
$('.fixed-left').css({left: 0}).addClass('collpased');
// $('.screen-btn').css({left: '360px'});
if (!$('.fixed-left').hasClass('active')) {
$('.screen-btn').css({left: '360px'});
}
});
$('.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.easy_slides.js"></script>
<script type="text/javascript" src="./js/demo.js"></script>
<script src="./js/map.js"></script>
<script>
$(document).ready(function () {
var graphContainer = document.getElementById('mainGraph');
@ -376,6 +373,15 @@
alert("nothing")
return 0
}
graphList = {"keyword":{
"nodes":[],
"links":[]
}}
currentGraph = {
nodes: {},
links: {},
};
category = 1;
fillInfo(result, name)
nodeMap = {};
graph = graphList.keyword
@ -405,11 +411,15 @@
}
redrawGraph();
loadVideo('西藏');
loadVideo(name);
// myChartGraph.resize();
}
init("西藏")
window.loadData = loadData;
window.initial = init;
window.myChartGraph = myChartGraph;
myChartGraph.on('click', function(params) {
if (params.dataType === "node") {
const node = nodeMap[params.data.name];
@ -471,6 +481,7 @@
</script>
<script type="text/javascript">
// window.init = init;
$(document).ready(function () {
$('.slider_one_big_picture').EasySlides({
'autoplay': true,
@ -568,7 +579,6 @@
// })
});
</script>
<script>
$(function(){
$(".show_detail").hover(function(){
@ -596,5 +606,7 @@
$(".voicePanel").removeClass("active");
}
</script>
<script src="./js/map.js"></script>
</body>
</html>