|
|
@ -2,12 +2,30 @@ var tsvPath
|
|
|
|
var stopwords = []
|
|
|
|
var stopwords = []
|
|
|
|
|
|
|
|
|
|
|
|
const init = () => {
|
|
|
|
const init = () => {
|
|
|
|
$(window).on('mousemove', function (e) {
|
|
|
|
$(window).on('mousemove', (e) => {
|
|
|
|
$('#nodeTitle').css({
|
|
|
|
$('#nodeTitle').css({
|
|
|
|
left: e.pageX,
|
|
|
|
left: e.pageX,
|
|
|
|
top: e.pageY
|
|
|
|
top: e.pageY
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
$('#minRatioLabel').on('mouseenter', () => {
|
|
|
|
|
|
|
|
$('#nodeTitle').removeClass('hidden')
|
|
|
|
|
|
|
|
$('#nodeTitleContent').html('兩個相鄰單詞之間出現頻率比值的最小值,小於該值不會被演算法選擇')
|
|
|
|
|
|
|
|
}).on('mouseleave', () => {
|
|
|
|
|
|
|
|
$('#nodeTitle').toggleClass('hidden')
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
$('#maxRatioLabel').on('mouseenter', () => {
|
|
|
|
|
|
|
|
$('#nodeTitle').removeClass('hidden')
|
|
|
|
|
|
|
|
$('#nodeTitleContent').html('兩個相鄰單詞之間出現頻率比值的最大值,大於該值不會被演算法選擇')
|
|
|
|
|
|
|
|
}).on('mouseleave', () => {
|
|
|
|
|
|
|
|
$('#nodeTitle').toggleClass('hidden')
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
$('#wordcount').on('mouseenter', () => {
|
|
|
|
|
|
|
|
$('#nodeTitle').removeClass('hidden')
|
|
|
|
|
|
|
|
$('#nodeTitleContent').html('僅計算中文字的字數')
|
|
|
|
|
|
|
|
}).on('mouseleave', () => {
|
|
|
|
|
|
|
|
$('#nodeTitle').toggleClass('hidden')
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function clearStopWord() {
|
|
|
|
function clearStopWord() {
|
|
|
@ -123,6 +141,12 @@ function buildSentetree() {
|
|
|
|
.on('nodeMouseleave', () => {
|
|
|
|
.on('nodeMouseleave', () => {
|
|
|
|
$('#nodeTitle').addClass('hidden')
|
|
|
|
$('#nodeTitle').addClass('hidden')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
.on('linkMouseenter', (node) => {
|
|
|
|
|
|
|
|
$('#nodeTitle').removeClass('hidden')
|
|
|
|
|
|
|
|
$('#nodeTitleContent').html('連線粗細:連接的兩個單詞同時出現的頻率<br>連線顏色:同層級單詞為灰色連線,不同層級為橘色連線')
|
|
|
|
|
|
|
|
}).on('linkMouseleave', () => {
|
|
|
|
|
|
|
|
$('#nodeTitle').addClass('hidden')
|
|
|
|
|
|
|
|
})
|
|
|
|
new ResizeSensor(jQuery('#d3kitRoot'), function () {
|
|
|
|
new ResizeSensor(jQuery('#d3kitRoot'), function () {
|
|
|
|
var scale, origin;
|
|
|
|
var scale, origin;
|
|
|
|
scale = Math.min(2, ($('#graph').outerWidth()) / ($('#d3kitRoot').outerWidth() + 60))
|
|
|
|
scale = Math.min(2, ($('#graph').outerWidth()) / ($('#d3kitRoot').outerWidth() + 60))
|
|
|
|