rootfs_enc1v2_hi3520d_20231130
|
@ -1,7 +1,7 @@
|
|||
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f01", RUN+="/etc/udev/usb4g.sh"
|
||||
ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="1a2b", RUN+="/etc/udev/usbWiFi.sh"
|
||||
SUBSYSTEM=="net", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="14db", KERNEL=="eth*", RUN+="/etc/udev/usbUp.sh %k"
|
||||
SUBSYSTEM=="net", KERNEL=="usb*", RUN+="/etc/udev/usbUp.sh %k"
|
||||
#SUBSYSTEM=="net", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="14db", KERNEL=="eth*", RUN+="/etc/udev/usbUp.sh %k"
|
||||
#SUBSYSTEM=="net", KERNEL=="usb*", RUN+="/etc/udev/usbUp.sh %k"
|
||||
ACTION=="add", KERNEL=="sd*", SUBSYSTEM=="block", RUN+="/link/shell/mountUsb.sh"
|
||||
ACTION=="remove",KERNEL=="sd*", SUBSYSTEM=="block", RUN+="/etc/udev/autounmount.sh"
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"enable":false,
|
||||
"server":"ntp1.aliyun.com"
|
||||
"server":"ntp1.aliyun.com",
|
||||
"interval":5
|
||||
}
|
||||
|
|
|
@ -7,22 +7,26 @@
|
|||
{
|
||||
"des": "platform 1",
|
||||
"enable": true,
|
||||
"path": "rtmp://127.0.0.1/live/push1"
|
||||
"path": "rtmp://127.0.0.1/live/push1",
|
||||
"flvflags": ""
|
||||
},
|
||||
{
|
||||
"des": "platform 2",
|
||||
"enable": false,
|
||||
"path": "rtmp://127.0.0.1/live/push2"
|
||||
"path": "rtmp://127.0.0.1/live/push2",
|
||||
"flvflags": ""
|
||||
},
|
||||
{
|
||||
"des": "platform 3",
|
||||
"enable": false,
|
||||
"path": "rtmp://127.0.0.1/live/push3"
|
||||
"path": "rtmp://127.0.0.1/live/push3",
|
||||
"flvflags": ""
|
||||
},
|
||||
{
|
||||
"des": "platform 4",
|
||||
"enable": false,
|
||||
"path": "rtmp://127.0.0.1/live/push4"
|
||||
"path": "rtmp://127.0.0.1/live/push4",
|
||||
"flvflags": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"ignore": [
|
||||
"lo",
|
||||
"wlan1",
|
||||
"wlan2"
|
||||
],
|
||||
"interface": {
|
||||
"eth0": {
|
||||
"dhcp": true,
|
||||
"dns": "192.168.1.1",
|
||||
"enable": true,
|
||||
"gw": "192.168.1.1",
|
||||
"ip": "192.168.1.217",
|
||||
"mask": "255.255.252.0"
|
||||
},
|
||||
"wlan0": {
|
||||
"dhcp": true,
|
||||
"dns": "192.168.1.1",
|
||||
"enable": true,
|
||||
"gw": "192.168.1.1",
|
||||
"ip": "192.168.1.218",
|
||||
"mask": "255.255.252.0"
|
||||
}
|
||||
},
|
||||
"onlineServer": "www.baidu.com",
|
||||
"onlineTest": false,
|
||||
"priority": [
|
||||
"lan",
|
||||
"wifi",
|
||||
"dongle",
|
||||
"other"
|
||||
]
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"enable":false,
|
||||
"server":"ntp1.aliyun.com"
|
||||
"server":"ntp1.aliyun.com",
|
||||
"interval":5
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"used": "dark",
|
||||
"themes": [
|
||||
"default",
|
||||
"salmon",
|
||||
"skyBlue"
|
||||
]
|
||||
}
|
|
@ -1,4 +1,15 @@
|
|||
[
|
||||
{
|
||||
"version": "2.8.0 build 20231130",
|
||||
"logs": [
|
||||
"优化分段录制功能",
|
||||
"NTP同步增加定时同步间隔",
|
||||
"修正NTP同步导致的录制、拉流异常问题",
|
||||
"修正ENC1V3、ENCSHV2等机型udp乱序问题",
|
||||
"修正开启特效的通道不能超过8个的问题",
|
||||
"除ENCSH机型外,新增全新的后台管理页面,可在经典版(原版)和标准版之间自由切换"
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.7.0 build 20231031",
|
||||
"logs": [
|
||||
|
@ -76,61 +87,5 @@
|
|||
"视频轮播支持解码、重编码(即U盘播放、推流)",
|
||||
"实验室新增抠像功能,即绿幕抠图"
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.0.0 build 20230322",
|
||||
"logs": [
|
||||
"运行状态页面,修正网络状态上下行显示问题",
|
||||
"编码设置页面,视频参数模块下,新增视频网络流裁剪旋转功能,HDMI/SDI通道新增NTSC兼容帧率模式",
|
||||
"编码设置页面,音频参数模块下,音源选择支持选择其他视频通道的音频",
|
||||
"输出设置页面,播放地址模块下,新增主码流/辅码流地址(标识)自定义功能",
|
||||
"系统设置页面,新增配置文件批量导出、导入功能,新增时区选择功能",
|
||||
"多平台直播页面,推流新增主码流/辅助码流选择功能",
|
||||
"默认网络流无信号时显示nosignal画面功能,可以通过fac.php页面开启/关闭此功能",
|
||||
"修正部分页面的翻译不正确问题,及其他部分功能优化",
|
||||
"菜单栏新增实验室模块,包含GB28181支持、ROI感兴趣编码区、Insta360相机控制、Onvif PTZ控制、音视频同步调节功能",
|
||||
"PS: 实验室模块属于实验性功能,请酌情使用"
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.0.0 build 20221116",
|
||||
"logs": [
|
||||
"新增在线检测升级功能",
|
||||
"新增固件在线查找功能",
|
||||
"h5播放器页面新增h265编码播放支持(播放h265编码视频流对电脑性能要求较高,如遇卡顿问题,请更换性能更好的电脑播放)",
|
||||
"rtsp输出流,新增账号密码认证功能",
|
||||
"扩展功能下新增U盘助手功能",
|
||||
"更新内核,增加设备稳定性",
|
||||
"兼容含B帧视频流解码",
|
||||
"支持wifi6网卡2.0版本",
|
||||
"修正使用wifi网卡时,获取网络状态异常问题"
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.0.0 build 20220705",
|
||||
"logs": [
|
||||
"修复使用usb相机时,重启设备后小概率出现音频采集异常问题",
|
||||
"修复USB相机插拔后,USB相机音频不能采集问题",
|
||||
"优化无效srt流导致的Encoder程序文件句柄增加问题",
|
||||
"修复设备绑定wx.linkpi.cn后,自定义布局管理器加载异常问题",
|
||||
"全机型增加HTTP API接口,优化HTTP API的URL匹配规则",
|
||||
"登录框改为水平、垂直居中,移除输入框自动填充密码时的填充颜色",
|
||||
"修复多网卡设备获取网络状态异常问题",
|
||||
"ENC1、ENC1V2、ENCSH机型对讲功能新增按键发言",
|
||||
"修正群组设置辅流问题"
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.0.0 build 20220518",
|
||||
"logs": [
|
||||
"修正NDI5无法解码NDI4的H265流问题",
|
||||
"修正油管直播卡顿的问题"
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.0.0 build 20220424",
|
||||
"logs": [
|
||||
"升级为NDI5(已购买授权的NDI4用户,需要联系客服更换授权码)"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"app": "2.0.0 build 20220512_869",
|
||||
"sdk": "2.0.0 build 20220518_20716",
|
||||
"sys": "2.7.0 build 20231031"
|
||||
"sys": "2.8.0 build 20231130"
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ fi
|
|||
if [ "$ip" == "" ]; then
|
||||
exit 0
|
||||
fi
|
||||
dns=`echo $dns |awk -F ' ' '{print $1}'`
|
||||
echo "dhcp_result"
|
||||
echo "dev:"$interface
|
||||
echo "ip:"$ip
|
||||
|
|
|
@ -10,4 +10,5 @@ echo "dev:"$interface
|
|||
echo "ip:"$ip
|
||||
echo "mask:"$subnet
|
||||
echo "gw:"$router
|
||||
dns=`echo $dns |awk -F ' ' '{print $1}'`
|
||||
echo "dns:"$dns
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
while [ true ]
|
||||
do
|
||||
/link/bin/NetManager
|
||||
sleep 2
|
||||
done
|
|
@ -1,9 +1,25 @@
|
|||
. /link/shell/util/hardware.sh
|
||||
/link/shell/setMac.sh
|
||||
sleep 1
|
||||
/link/shell/setNetwork.sh
|
||||
sleep 2
|
||||
/link/bin/WifiCtrl &
|
||||
if [ -f /link/config/auto/webVer.json ] && web=$(jq -r ".web" /link/config/auto/webVer.json) && [ "$web" != "classic" ] ;then
|
||||
cp /usr/nginx/conf/nginx_standard.conf /usr/nginx/conf/nginx.conf
|
||||
title=`grep -o '<title>.*</title>' /link/web/headhead.php | sed -e 's/<title>\(.*\)<\/title>/\1/'`
|
||||
footer=`awk '/<div class="container">/,/<\/div>/' /link/web/foot.php | grep -o '<div>.*<\/div>' | sed -e 's/<div>\(.*\)<\/div>/\1/' | sed -e 's/<\/div>//g'`
|
||||
sed -i "s/<title>.*<\/title>/<title>${title}<\/title>/" /link/webflex/public/headhead.inc
|
||||
sed -i '/<div class=".*d-flex.*">/,/<\/div>/ s/>[^<]*</>'"${footer}"'</g' /link/webflex/public/footfoot.inc
|
||||
rm -rf /link/webflex/assets/img
|
||||
ln -s /link/web/img /link/webflex/assets/
|
||||
cp /link/web/favicon.ico /link/webflex/
|
||||
sync
|
||||
/link/shell/net.sh &
|
||||
sleep 2
|
||||
else
|
||||
cp /usr/nginx/conf/nginx_classic.conf /usr/nginx/conf/nginx.conf
|
||||
sync
|
||||
/link/shell/setNetwork.sh
|
||||
sleep 2
|
||||
/link/bin/WifiCtrl &
|
||||
fi
|
||||
|
||||
if [ -d /sys/class/net/eth1 ]; then
|
||||
/link/shell/setMac2.sh
|
||||
|
|
|
@ -5,8 +5,9 @@ do
|
|||
jopen /link/config/ntp.json
|
||||
if [ `jget enable` == "true" ]; then
|
||||
if ! procExists ntpd ;then
|
||||
ntpd -p `jget server` -N
|
||||
ntpd -p `jget server` -Nnq
|
||||
fi
|
||||
sleep $((`jget interval`*60))
|
||||
else
|
||||
pkill ntpd
|
||||
fi
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if [ ! -f "/link/config/mac" ]; then
|
||||
if [ ! -f "/link/config/mac" ] || [ ! -s /link/config/mac ] || [ -z "$(cat /link/config/mac)" ]; then
|
||||
/link/shell/makeMac.sh > /link/config/mac
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if [ ! -f "/link/config/mac2" ]; then
|
||||
if [ ! -f "/link/config/mac2" ] || [ ! -s /link/config/mac2 ] || [ -z "$(cat /link/config/mac2)" ]; then
|
||||
/link/shell/makeMac.sh > /dev/null
|
||||
/link/shell/makeMac.sh > /link/config/mac2
|
||||
fi
|
||||
|
|
|
@ -33,6 +33,9 @@ en,cn{
|
|||
color: #FFF;
|
||||
|
||||
}
|
||||
#defaultNavbar1 {
|
||||
min-width: 1200px;
|
||||
}
|
||||
.navbar .dropdown-menu{
|
||||
background-color: #333;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ include( "head.php" );
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group" data-attr-used="net">
|
||||
<label class="col-md-3 col-sm-4 control-label"><cn>协议</cn><en>type</en></label>
|
||||
<label class="col-md-3 col-sm-4 control-label"><cn>协议</cn><en>Protocol</en></label>
|
||||
<div class="col-md-6 col-sm-8">
|
||||
<select zcfg="shared.type" class="form-control" id="mountType">
|
||||
<option value="cifs" cn="cifs (windows共享目录)" en="cifs (windows shared directory)"></option>
|
||||
|
|
|
@ -198,6 +198,8 @@ function setNtp() {
|
|||
$data = json_decode( $json_string, true );
|
||||
$data[ 'server' ] = $_POST[ 'server' ];
|
||||
$data[ 'enable' ] = ($_POST[ 'enable' ]=="true");
|
||||
if(isset($_POST[ 'interval' ]))
|
||||
$data[ 'interval' ] = $_POST[ 'interval' ];
|
||||
$json = json_encode( $data );
|
||||
file_put_contents( '/link/config/ntp.json', $json );
|
||||
}
|
||||
|
@ -500,6 +502,30 @@ function checkHelpNet() {
|
|||
$result->result = "ok";
|
||||
}
|
||||
|
||||
function changeWebVersion() {
|
||||
global $result;
|
||||
if($_POST["type"] == "standard")
|
||||
{
|
||||
$net = json_decode(file_get_contents("/link/config/net.json"),true);
|
||||
$wifi = json_decode(file_get_contents("/link/config/wifi.json"),true);
|
||||
$netManager = json_decode(file_get_contents("/link/config/netManager.json"),true);
|
||||
|
||||
$net["enable"] = true;
|
||||
$net["gw"] = $net["gateway"];
|
||||
unset($net["gateway"]);
|
||||
$wifi["gw"] = $net["gateway"];
|
||||
unset($wifi["gateway"]);
|
||||
|
||||
$netManager["interface"]["eth0"] = $net;
|
||||
$netManager["interface"]["wlan0"] = $wifi;
|
||||
|
||||
file_put_contents("/link/config/netManager.json",json_encode($netManager,JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT));
|
||||
file_put_contents("/link/config/auto/webVer.json",json_encode(array("web"=>"standard")));
|
||||
exec("sync && reboot");
|
||||
}
|
||||
$result->result = "OK";
|
||||
}
|
||||
|
||||
function checkUpdate() {
|
||||
global $result,$server;
|
||||
$hardware = json_decode(file_get_contents('/link/config/hardware.json'), true);
|
||||
|
|
|
@ -3,13 +3,17 @@ include("hardware.php");
|
|||
include("session.php");
|
||||
include("headhead.php");
|
||||
?>
|
||||
|
||||
<script type="text/javascript" language="javascript" src="js/confirm/jquery-confirm.min.js"></script>
|
||||
<nav class="navbar navbar-default">
|
||||
<div class="container">
|
||||
<!-- Brand and toggle get grouped for better mobile display -->
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#defaultNavbar1"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>
|
||||
<a class="navbar-brand" href="dashboard.php"> <img src="img/logo.png" style="width: 97px; height: 40px;" class="visible-xs-block visible-sm-block" /> <img src="img/logo.png" class="visible-md-block visible-lg-block" /> </a>
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#defaultNavbar1">
|
||||
<span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span
|
||||
class="icon-bar"></span><span class="icon-bar"></span></button>
|
||||
<a class="navbar-brand" href="dashboard.php"> <img src="img/logo.png" style="width: 97px; height: 40px;"
|
||||
class="visible-xs-block visible-sm-block"/> <img
|
||||
src="img/logo.png" class="visible-md-block visible-lg-block"/> </a>
|
||||
</div>
|
||||
<!-- Collect the nav links, forms, and other content for toggling -->
|
||||
<div class="collapse navbar-collapse" id="defaultNavbar1">
|
||||
|
@ -36,9 +40,12 @@ include("headhead.php");
|
|||
<?php
|
||||
}
|
||||
?>
|
||||
<li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-puzzle-piece menuIcon"></i>
|
||||
<li role="presentation" class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#"
|
||||
role="button" aria-haspopup="true" aria-expanded="false"> <i
|
||||
class="fa fa-puzzle-piece menuIcon"></i>
|
||||
<cn>扩展功能</cn>
|
||||
<en>Extend</en><span class="caret"></span>
|
||||
<en>Extend</en>
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<?php
|
||||
|
@ -54,7 +61,8 @@ include("headhead.php");
|
|||
<?php
|
||||
if ($hardware["function"]["ndi"] && $hardware["function"]["videoOut"]) {
|
||||
?>
|
||||
<li><a href="ndi.php"><i class="fa fa-television"></i>NDI <cn>解码</cn>
|
||||
<li><a href="ndi.php"><i class="fa fa-television"></i>NDI
|
||||
<cn>解码</cn>
|
||||
<en>decode</en>
|
||||
</a></li>
|
||||
<?php
|
||||
|
@ -128,9 +136,12 @@ include("headhead.php");
|
|||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true"> <i class="fa fa-gears menuIcon"></i>
|
||||
<li role="presentation" class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#"
|
||||
role="button" aria-haspopup="true" aria-expanded="true"> <i
|
||||
class="fa fa-gears menuIcon"></i>
|
||||
<cn>高级设置</cn>
|
||||
<en>Options</en><span class="caret"></span>
|
||||
<en>Options</en>
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="sys.php"><i class="fa fa-gear"></i>
|
||||
|
@ -151,20 +162,30 @@ include("headhead.php");
|
|||
</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true"> <i class="fa fa-flask menuIcon"></i>
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true"
|
||||
aria-expanded="true">
|
||||
<i class="fa fa-flask menuIcon"></i>
|
||||
<cn>实验室</cn>
|
||||
<en>Laboratory</en><span class="caret"></span>
|
||||
<en>Laboratory</en>
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="gb28181.php"><i class="fa fa-cloud"></i>GB28181</a></li>
|
||||
<li><a href="roi.php"><i class="fa fa-user-circle-o"></i>ROI</a></li>
|
||||
<li><a href="insta360.php"><i class="fa fa-camera"></i>Insta360 Link</a></li>
|
||||
<li>
|
||||
<svg style="position: absolute;margin: 5px 0px 0px 18px;" width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M43 6H23H5" stroke="#fff" stroke-width="4" stroke-linecap="square" stroke-linejoin="miter" />
|
||||
<path d="M23 23V6" stroke="#fff" stroke-width="4" stroke-linecap="square" stroke-linejoin="miter" />
|
||||
<path d="M8.42498 19.5798L40.3005 28.1209L38.5581 30.7598L34.5557 37.9696L32.8133 40.6085L4.80151 33.1028L8.42498 19.5798Z" fill="#fff" stroke="#fff" stroke-width="4" stroke-linecap="square" stroke-linejoin="miter" />
|
||||
<path d="M38.5583 30.7598L42.422 31.7951L40.3515 39.5225L34.5559 37.9696" stroke="#fff" stroke-width="4" stroke-linecap="square" stroke-linejoin="miter" />
|
||||
<svg style="position: absolute;margin: 5px 0px 0px 18px;" width="16" height="16"
|
||||
viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M43 6H23H5" stroke="#fff" stroke-width="4" stroke-linecap="square"
|
||||
stroke-linejoin="miter"/>
|
||||
<path d="M23 23V6" stroke="#fff" stroke-width="4" stroke-linecap="square"
|
||||
stroke-linejoin="miter"/>
|
||||
<path d="M8.42498 19.5798L40.3005 28.1209L38.5581 30.7598L34.5557 37.9696L32.8133 40.6085L4.80151 33.1028L8.42498 19.5798Z"
|
||||
fill="#fff" stroke="#fff" stroke-width="4" stroke-linecap="square"
|
||||
stroke-linejoin="miter"/>
|
||||
<path d="M38.5583 30.7598L42.422 31.7951L40.3515 39.5225L34.5559 37.9696" stroke="#fff"
|
||||
stroke-width="4" stroke-linecap="square" stroke-linejoin="miter"/>
|
||||
</svg>
|
||||
<a style="padding-left: 38px;" href="onvif.php">Onvif PTZ</a>
|
||||
</li>
|
||||
|
@ -180,19 +201,39 @@ include("headhead.php");
|
|||
</li>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navr">
|
||||
<li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true"> <i class="fa fa-globe"></i>
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true"
|
||||
aria-expanded="true"> <i class="fa fa-globe"></i>
|
||||
<en>语言</en>
|
||||
<cn>Language</cn><span class="caret"></span>
|
||||
<cn>Language</cn>
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#" onClick="changeLang('en');">English</a></li>
|
||||
<li><a href="#" onClick="changeLang('cn');">中文</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li> <a id="logout" class="btn btn-default" href="login.php?logout=true"> <i class="fa fa-sign-out"></i>
|
||||
<?php
|
||||
if ($hardware["fac"] != "SH") {
|
||||
?>
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true"
|
||||
aria-expanded="true"> <i class="fa fa-exchange"></i>
|
||||
<en>Classic</en>
|
||||
<cn>经典版</cn>
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#" onClick="changeWeb('standard');"><cn>标准版</cn><en>Standard</en></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<li><a id="logout" class="btn btn-default" href="login.php?logout=true"> <i class="fa fa-sign-out"></i>
|
||||
<en>Sign out</en>
|
||||
<cn>退出</cn>
|
||||
</a> </li>
|
||||
</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -114,6 +114,27 @@ function changeLang(lang){
|
|||
func("saveConfigFile",{path: "config/lang.json",data:JSON.stringify({"lang":lang},null,2)});
|
||||
}
|
||||
|
||||
function changeWeb(type){
|
||||
$.confirm({
|
||||
title: '<cn>切换版本</cn><en>Switch Web</en>',
|
||||
content: '<cn>是否切换至标准版页面,并重新启动?</cn><en>Whether to switch to the standard version and restart?</en>',
|
||||
buttons: {
|
||||
ok: {
|
||||
text: "<cn>切换</cn><en>Switch</en>",
|
||||
btnClass: 'btn-warning',
|
||||
keys: ['enter'],
|
||||
action: function() {
|
||||
func("changeWebVersion",{"type":type});
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
text: "<cn>取消</cn><en>Cancel</en>"
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getUsedTheme() {
|
||||
var theme = "";
|
||||
$.ajaxSettings.async = false;
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
{
|
||||
"files": {
|
||||
"main.css": "./mixer/static/css/main.6dd9bbee.chunk.css",
|
||||
"main.js": "./mixer/static/js/main.6b7b874e.chunk.js",
|
||||
"main.js.map": "./mixer/static/js/main.6b7b874e.chunk.js.map",
|
||||
"main.css": "./mixer/static/css/main.375af961.chunk.css",
|
||||
"main.js": "./mixer/static/js/main.84be4e27.chunk.js",
|
||||
"main.js.map": "./mixer/static/js/main.84be4e27.chunk.js.map",
|
||||
"runtime-main.js": "./mixer/static/js/runtime-main.c45edf70.js",
|
||||
"runtime-main.js.map": "./mixer/static/js/runtime-main.c45edf70.js.map",
|
||||
"static/css/2.0b7c8b97.chunk.css": "./mixer/static/css/2.0b7c8b97.chunk.css",
|
||||
"static/js/2.9e080cb5.chunk.js": "./mixer/static/js/2.9e080cb5.chunk.js",
|
||||
"static/js/2.9e080cb5.chunk.js.map": "./mixer/static/js/2.9e080cb5.chunk.js.map",
|
||||
"static/js/2.f2aad125.chunk.js": "./mixer/static/js/2.f2aad125.chunk.js",
|
||||
"static/js/2.f2aad125.chunk.js.map": "./mixer/static/js/2.f2aad125.chunk.js.map",
|
||||
"index.html": "./mixer/index.html",
|
||||
"precache-manifest.848a3755896ae918201f90b392131186.js": "./mixer/precache-manifest.848a3755896ae918201f90b392131186.js",
|
||||
"precache-manifest.58ca0a035d7d4a54ca84834ef500469e.js": "./mixer/precache-manifest.58ca0a035d7d4a54ca84834ef500469e.js",
|
||||
"service-worker.js": "./mixer/service-worker.js",
|
||||
"static/css/2.0b7c8b97.chunk.css.map": "./mixer/static/css/2.0b7c8b97.chunk.css.map",
|
||||
"static/css/main.6dd9bbee.chunk.css.map": "./mixer/static/css/main.6dd9bbee.chunk.css.map",
|
||||
"static/js/2.9e080cb5.chunk.js.LICENSE.txt": "./mixer/static/js/2.9e080cb5.chunk.js.LICENSE.txt",
|
||||
"static/js/main.6b7b874e.chunk.js.LICENSE.txt": "./mixer/static/js/main.6b7b874e.chunk.js.LICENSE.txt"
|
||||
"static/css/main.375af961.chunk.css.map": "./mixer/static/css/main.375af961.chunk.css.map",
|
||||
"static/js/2.f2aad125.chunk.js.LICENSE.txt": "./mixer/static/js/2.f2aad125.chunk.js.LICENSE.txt",
|
||||
"static/js/main.84be4e27.chunk.js.LICENSE.txt": "./mixer/static/js/main.84be4e27.chunk.js.LICENSE.txt"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/js/runtime-main.c45edf70.js",
|
||||
"static/css/2.0b7c8b97.chunk.css",
|
||||
"static/js/2.9e080cb5.chunk.js",
|
||||
"static/css/main.6dd9bbee.chunk.css",
|
||||
"static/js/main.6b7b874e.chunk.js"
|
||||
"static/js/2.f2aad125.chunk.js",
|
||||
"static/css/main.375af961.chunk.css",
|
||||
"static/js/main.84be4e27.chunk.js"
|
||||
]
|
||||
}
|
|
@ -1 +1 @@
|
|||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./mixer/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="./mixer/logo192.png"/><link rel="manifest" href="./mixer/manifest.json"/><title>React App</title><link href="./mixer/static/css/2.0b7c8b97.chunk.css" rel="stylesheet"><link href="./mixer/static/css/main.6dd9bbee.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,l=r[0],f=r[1],a=r[2],c=0,s=[];c<l.length;c++)i=l[c],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&s.push(o[i][0]),o[i]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,l=1;l<t.length;l++){var f=t[l];0!==o[f]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="./mixer/";var l=this.webpackJsonpmixer=this.webpackJsonpmixer||[],f=l.push.bind(l);l.push=r,l=l.slice();for(var a=0;a<l.length;a++)r(l[a]);var p=f;t()}([])</script><script src="./mixer/static/js/2.9e080cb5.chunk.js"></script><script src="./mixer/static/js/main.6b7b874e.chunk.js"></script></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./mixer/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="./mixer/logo192.png"/><link rel="manifest" href="./mixer/manifest.json"/><title>React App</title><link href="./mixer/static/css/2.0b7c8b97.chunk.css" rel="stylesheet"><link href="./mixer/static/css/main.375af961.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,l=r[0],f=r[1],a=r[2],c=0,s=[];c<l.length;c++)i=l[c],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&s.push(o[i][0]),o[i]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,l=1;l<t.length;l++){var f=t[l];0!==o[f]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="./mixer/";var l=this.webpackJsonpmixer=this.webpackJsonpmixer||[],f=l.push.bind(l);l.push=r,l=l.slice();for(var a=0;a<l.length;a++)r(l[a]);var p=f;t()}([])</script><script src="./mixer/static/js/2.f2aad125.chunk.js"></script><script src="./mixer/static/js/main.84be4e27.chunk.js"></script></body></html>
|
|
@ -0,0 +1,34 @@
|
|||
self.__precacheManifest = (self.__precacheManifest || []).concat([
|
||||
{
|
||||
"revision": "6ff46d5756d540930c2999120856ece5",
|
||||
"url": "./mixer/index.html"
|
||||
},
|
||||
{
|
||||
"revision": "25cc111d980ef7eb4b05",
|
||||
"url": "./mixer/static/css/2.0b7c8b97.chunk.css"
|
||||
},
|
||||
{
|
||||
"revision": "9483588bccb1a222f49b",
|
||||
"url": "./mixer/static/css/main.375af961.chunk.css"
|
||||
},
|
||||
{
|
||||
"revision": "25cc111d980ef7eb4b05",
|
||||
"url": "./mixer/static/js/2.f2aad125.chunk.js"
|
||||
},
|
||||
{
|
||||
"revision": "4390933dc3b3a92d4f565fd4f47c3cd7",
|
||||
"url": "./mixer/static/js/2.f2aad125.chunk.js.LICENSE.txt"
|
||||
},
|
||||
{
|
||||
"revision": "9483588bccb1a222f49b",
|
||||
"url": "./mixer/static/js/main.84be4e27.chunk.js"
|
||||
},
|
||||
{
|
||||
"revision": "5c84e2504d745b1010aeb6ce2aad7554",
|
||||
"url": "./mixer/static/js/main.84be4e27.chunk.js.LICENSE.txt"
|
||||
},
|
||||
{
|
||||
"revision": "96af6c8d9af51963848a",
|
||||
"url": "./mixer/static/js/runtime-main.c45edf70.js"
|
||||
}
|
||||
]);
|
|
@ -14,7 +14,7 @@
|
|||
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
|
||||
|
||||
importScripts(
|
||||
"./mixer/precache-manifest.848a3755896ae918201f90b392131186.js"
|
||||
"./mixer/precache-manifest.58ca0a035d7d4a54ca84834ef500469e.js"
|
||||
);
|
||||
|
||||
self.addEventListener('message', (event) => {
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
object-assign
|
||||
(c) Sindre Sorhus
|
||||
@license MIT
|
||||
*/
|
||||
|
||||
/*!
|
||||
Copyright (c) 2018 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/
|
||||
|
||||
/*!
|
||||
* cookie
|
||||
* Copyright(c) 2012-2014 Roman Shtylman
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||
|
||||
/** @license React v0.19.1
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/** @license React v16.13.1
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/** @license React v16.14.0
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/** @license React v16.14.0
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/** @license React v17.0.2
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
|
@ -0,0 +1,26 @@
|
|||
/*!
|
||||
* Sizzle CSS Selector Engine v2.3.4
|
||||
* https://sizzlejs.com/
|
||||
*
|
||||
* Copyright JS Foundation and other contributors
|
||||
* Released under the MIT license
|
||||
* https://js.foundation/
|
||||
*
|
||||
* Date: 2019-04-08
|
||||
*/
|
||||
|
||||
/*!
|
||||
* jQuery JavaScript Library v3.4.1
|
||||
* https://jquery.com/
|
||||
*
|
||||
* Includes Sizzle.js
|
||||
* https://sizzlejs.com/
|
||||
*
|
||||
* Copyright JS Foundation and other contributors
|
||||
* Released under the MIT license
|
||||
* https://jquery.org/license
|
||||
*
|
||||
* Date: 2019-05-01T21:04Z
|
||||
*/
|
||||
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
@ -454,6 +454,24 @@ include( "head.php" );
|
|||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="form-horizontal" role="form" id="ntp">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">
|
||||
<cn>同步间隔</cn>
|
||||
<en>sync interval</en>
|
||||
</label>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group">
|
||||
<input type="text" zcfg="interval" class="form-control"/>
|
||||
<span class="input-group-addon">
|
||||
<cn>分钟</cn>
|
||||
<en>min</en>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="form-horizontal" role="form" id="timeZone">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">
|
||||
|
@ -564,7 +582,7 @@ include( "head.php" );
|
|||
<div class="panel-body" id="upConfig">
|
||||
<div class="text-center">
|
||||
<div id="alertUpcfg"></div>
|
||||
<div class="row" style="margin-top: 20px;">
|
||||
<div class="row" style="margin-top: 40px;">
|
||||
<div class="col-md-10 col-md-offset-1">
|
||||
<div class="row">
|
||||
<div class="col-md-3 text-center" style="padding: 0"><cn>编解码配置</cn><en>Default Config</en></div>
|
||||
|
@ -636,6 +654,8 @@ include( "head.php" );
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-bottom: 31px">
|
||||
<div class="col-md-12">
|
||||
<input type="file" accept=".zip" name="cfg_file" id="cfg_file" style="display:none;" />
|
||||
<button id="packageConfs" type="button" class="btn btn-warning" style="width: 82px;margin-right: 10px;">
|
||||
<cn>导出</cn>
|
||||
|
@ -649,6 +669,8 @@ include( "head.php" );
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if($hardware["function"]["portCtrl"])
|
||||
|
@ -1361,7 +1383,7 @@ if($hardware["function"]["portCtrl"])
|
|||
}
|
||||
} );
|
||||
} );
|
||||
<?
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
var netConfig;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
location /link {rewrite ^(.*)/link/([a-zA-Z0-9\_]+)/([a-zA-Z0-9\_]+)$ $1/link/monitor.php?class=$2&func=$3&verify=true&login=true last;}
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
[data-bs-language=cn] cn {
|
||||
display: inline;
|
||||
}
|
||||
[data-bs-language=cn] en {
|
||||
display: none;
|
||||
}
|
||||
|
||||
[data-bs-language=en] cn {
|
||||
display: none;
|
||||
}
|
||||
[data-bs-language=en] en {
|
||||
display: inline;
|
||||
}
|
|
@ -0,0 +1,610 @@
|
|||
|
||||
[data-bs-theme=dark] {
|
||||
--bs-body-color-semi: #adb5bd;
|
||||
--bs-body-bg-semi-2:#191b1e;
|
||||
--bs-light-text-semi: #f8f9fa;
|
||||
--bs-border-color: #dee2e6;
|
||||
--bs-body-bg-color: #f0f0f4;
|
||||
|
||||
--bs-default-simplebar-color: #727477;
|
||||
--bs-default-auth-border-color:#495057;
|
||||
--bs-default-body-color:#555;
|
||||
--bs-default-primary-bg:#fb0;
|
||||
--bs-default-active-bg-color:#ffbb00;
|
||||
--bs-default-body-bg-color:#1f2226;
|
||||
--bs-default-bg-color:#212529;
|
||||
--bs-default-txt-color:#333;
|
||||
--bs-default-acitve-color:#eeaa00;
|
||||
--bs-default-hr-color:#585858;
|
||||
--bs-default-nav-color:#999999;
|
||||
--bs-default-nav-active-color:#333;
|
||||
--bs-default-slider-color:#fb0;
|
||||
--bs-default-slider-bg-color:#ffbb00;
|
||||
--bs-default-form-border-color:#434343;
|
||||
--bs-default-form-color:#adb5bd;
|
||||
}
|
||||
|
||||
/* body */
|
||||
[data-bs-theme=dark] body {
|
||||
background-color:var(--bs-default-body-bg-color);
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .simplebar-scrollbar:before {
|
||||
background-color: var(--bs-default-simplebar-color);
|
||||
}
|
||||
|
||||
/* sidebar */
|
||||
[data-bs-theme=dark] .sidebar-wrapper .sidebar-nav,
|
||||
[data-bs-theme=dark] .sidebar-wrapper .sidebar-header,
|
||||
[data-bs-theme=dark] .sidebar-wrapper .sidebar-bottom,
|
||||
[data-bs-theme=dark] .sidebar-wrapper {
|
||||
background-color: var(--bs-default-bg-color);
|
||||
border-color:var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .sidebar-wrapper .sidebar-header .logo-name h5 {
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
|
||||
[data-bs-theme=dark] .sidebar-wrapper .sidebar-bottom .user-info .user-name {
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .sidebar-wrapper .sidebar-header .sidebar-close {
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .sidebar-wrapper .sidebar-bottom .user-info .user-designation {
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .sidebar-wrapper .sidebar-bottom .dropdown-menu {
|
||||
|
||||
background-color: var(--bs-body-bg-semi-2);
|
||||
border-color:var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .sidebar-wrapper .sidebar-bottom .dropdown-menu .dropdown-item {
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .sidebar-wrapper .sidebar-bottom .dropdown-menu .dropdown-item:hover {
|
||||
background-color: var(--bs-default-bg-color);
|
||||
}
|
||||
|
||||
|
||||
[data-bs-theme=dark] .sidebar-wrapper .metismenu a {
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .sidebar-wrapper .metismenu .mm-active>a {
|
||||
color: var(--bs-default-active-bg-color);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .sidebar-wrapper .metismenu a .parent-icon {
|
||||
color: var(--bs-body-color-semi);
|
||||
background-color: var(--bs-default-bg-color);
|
||||
border-color:var(--bs-border-color-translucent)
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .sidebar-wrapper .metismenu .mm-active>a .parent-icon,
|
||||
[data-bs-theme=dark] .sidebar-wrapper .metismenu a:hover .parent-icon,
|
||||
[data-bs-theme=dark] .sidebar-wrapper .metismenu a:focus .parent-icon,
|
||||
[data-bs-theme=dark] .sidebar-wrapper .metismenu a:active .parent-icon {
|
||||
color: var(--bs-default-txt-color);
|
||||
text-decoration: none;
|
||||
background: var(--bs-default-active-bg-color);
|
||||
border-color: var(--bs-default-active-bg-color);
|
||||
transition: ease-out .3s;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .sidebar-wrapper .metismenu ul {
|
||||
background-color: var(--bs-default-bg-color);
|
||||
}
|
||||
|
||||
/*header*/
|
||||
[data-bs-theme=dark] .top-header .navbar {
|
||||
background-color: var(--bs-default-bg-color);
|
||||
border-bottom: 1px solid var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .top-header .navbar .top-right-menu .nav-item .nav-link,
|
||||
[data-bs-theme=dark] .top-header .navbar .btn-toggle-menu {
|
||||
color: var(--bs-body-color);
|
||||
background-color: var(--bs-body-bg);
|
||||
border: 1px solid var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .search-bar input[disabled] {
|
||||
background-color: var(--bs-body-bg);
|
||||
border: 1px solid var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
/* button */
|
||||
[data-bs-theme=dark] .btn-default {
|
||||
background-color: var(--bs-body-color-semi);
|
||||
border-color: var(--bs-body-color-semi);
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
padding: 6px 12px;
|
||||
white-space: nowrap;
|
||||
border-radius: 4px;
|
||||
line-height: 1.2;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .btn-primary {
|
||||
background-color: var(--bs-default-active-bg-color);
|
||||
border-color: var(--bs-default-active-bg-color);
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
padding: 6px 12px;
|
||||
white-space: nowrap;
|
||||
border-radius: 4px;
|
||||
line-height: 1.2;
|
||||
color: var(--bs-default-txt-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .btn-primary.btn-sm {
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
padding: 5px 10px;
|
||||
white-space: nowrap;
|
||||
border-radius: 4px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .btn-primary.btn-df {
|
||||
padding: 0.375rem 0.75rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .btn-primary:hover {
|
||||
background-color: var(--bs-default-acitve-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .btn-primary:active {
|
||||
border-color: var(--bs-default-acitve-color);
|
||||
background-color: var(--bs-default-acitve-color);
|
||||
}
|
||||
|
||||
/* switch */
|
||||
[data-bs-theme=dark] .bootstrap-switch {
|
||||
border-color: var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .bootstrap-switch .bootstrap-switch-label {
|
||||
/*background-color: var(--bs-default-bg-color);*/
|
||||
background-color: #292e32;
|
||||
border-right: 1px solid var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary{
|
||||
background-color: var(--bs-default-active-bg-color);
|
||||
color: var(--bs-default-txt-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .bootstrap-switch .bootstrap-switch-handle-off {
|
||||
background-color: rgba(0,0,0,0.08);
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .bootstrap-switch-small {
|
||||
width: 66px !important;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .bootstrap-switch-small .bootstrap-switch-container {
|
||||
width: 104px !important;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .bootstrap-switch-small .bootstrap-switch-container .bootstrap-switch-label {
|
||||
width: 32px !important;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .bootstrap-switch-normal {
|
||||
width: 90px !important;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .bootstrap-switch-normal .bootstrap-switch-container {
|
||||
width: 140px !important;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .bootstrap-switch-normal .bootstrap-switch-container .bootstrap-switch-label {
|
||||
width: 40px !important;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .bootstrap-switch.bootstrap-switch-focused {
|
||||
border-color: transparent;
|
||||
/*box-shadow: none;*/
|
||||
/*border-color: #66afe9;*/
|
||||
outline: 0;
|
||||
-webkit-box-shadow: inset 0 1px 1px var(--bs-default-acitve-color), 0 0 8px var(--bs-default-acitve-color);
|
||||
box-shadow: inset 0 1px 1px var(--bs-default-acitve-color), 0 0 8px var(--bs-default-acitve-color);
|
||||
}
|
||||
|
||||
/* nav-tab */
|
||||
[data-bs-theme=dark] .nav-primary.nav-tabs {
|
||||
border-bottom: 1px solid var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .nav-primary.nav-tabs .nav-link {
|
||||
color: var(--bs-default-nav-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .nav-primary.nav-tabs .nav-link.active {
|
||||
transition: all .2s ease;
|
||||
color: var(--bs-body-color-semi)!important;
|
||||
padding-top:8px!important;
|
||||
border-radius: 0;
|
||||
background: var(--bs-default-bg-color);
|
||||
border-color: transparent;
|
||||
border-top: 4px solid var(--bs-default-active-bg-color) !important;
|
||||
border-left: 1px solid var(--bs-border-color-translucent) !important;
|
||||
border-right: 1px solid var(--bs-border-color-translucent) !important;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .nav-primary.nav-tabs .nav-link:hover {
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .nav-primary.nav-tabs .nav-link:hover {
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .nav-primary.nav-tabs .nav-link.active:hover {
|
||||
border-left-color: var(--bs-border-color-translucent) !important;
|
||||
border-right-color: var(--bs-border-color-translucent) !important;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .tab-content {
|
||||
background-color: var(--bs-default-bg-color);
|
||||
color: var(--bs-body-color-semi);
|
||||
border-bottom-left-radius: 6px;
|
||||
border-bottom-right-radius: 6px;
|
||||
border-left: 1px solid var(--bs-border-color-translucent);
|
||||
border-bottom: 1px solid var(--bs-border-color-translucent);
|
||||
border-right: 1px solid var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
/* hr */
|
||||
[data-bs-theme=dark] hr {
|
||||
color: var(--bs-default-hr-color);
|
||||
margin:0.6rem 0;
|
||||
}
|
||||
|
||||
/* input slect */
|
||||
[data-bs-theme=dark] .form-select,
|
||||
[data-bs-theme=dark] .form-control {
|
||||
/*color: var(--bs-body-color-semi);*/
|
||||
/*border-color: var(--bs-border-color-translucent);*/
|
||||
color: var(--bs-default-form-color);
|
||||
border-color: var(--bs-default-form-border-color);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* pace-progress */
|
||||
[data-bs-theme=dark] .pace .pace-progress {
|
||||
background: var(--bs-default-acitve-color);
|
||||
}
|
||||
|
||||
|
||||
/* slider */
|
||||
|
||||
[data-bs-theme=dark] .slider-wrap,
|
||||
[data-bs-theme=dark] .slider-wrap .noUi-handle {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .slider-wrap .noUi-handle::before, .slider-wrap .noUi-handle::after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .slider-wrap.noUi-handle .noUi-touch-area {
|
||||
border: 1px solid transparent;
|
||||
position: absolute;
|
||||
top: -10px;
|
||||
left: -10px;
|
||||
right: -10px;
|
||||
bottom: -10px;
|
||||
width: auto;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .slider-wrap.noUi-handle:hover .noUi-touch-area {
|
||||
border: 1px dashed #7f7f7f;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .slider-wrap {
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .slider-wrap.noUi-target {
|
||||
border : none;
|
||||
box-shadow: inset 0 1px 2px rgba(0,0,0,0.66);
|
||||
background-color: #383838;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .slider-wrap .noUi-connects {
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .slider-wrap .noUi-connect {
|
||||
background: var(--bs-default-slider-bg-color);
|
||||
border-color: var(--bs-default-slider-bg-color);
|
||||
box-shadow: inset 0 -1px 0 rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .slider-wrap .noUi-handle {
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
top: -5px;
|
||||
right: -10px; /* half the width */
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
background-color: var(--bs-default-slider-color);
|
||||
border-color: var(--bs-default-slider-color);
|
||||
}
|
||||
|
||||
/*checkbox*/
|
||||
[data-bs-theme=dark] .form-check-primary .form-check-input:checked {
|
||||
background-color: var(--bs-default-acitve-color);
|
||||
border-color: var(--bs-default-acitve-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .form-check-primary .form-check-input:not(:checked):not(:focus) {
|
||||
--bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28255, 255, 255, 0.25%29'/%3e%3c/svg%3e");
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .form-check-primary .form-check-input:not(:checked):focus,
|
||||
[data-bs-theme=dark] .form-check-primary .form-check-input:checked:focus
|
||||
{
|
||||
border-color: var(--bs-default-acitve-color);
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 .25rem rgba(255, 193, 7, 0.25)
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .jconfirm.jconfirm-white .jconfirm-bg,
|
||||
[data-bs-theme=dark] .jconfirm.jconfirm-light .jconfirm-bg {
|
||||
background-color: #626262;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .jconfirm .jconfirm-box {
|
||||
background-color: var(--bs-default-bg-color);
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .jconfirm .jconfirm-box .input-group-text {
|
||||
background-color: transparent;
|
||||
border-color: var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .lp-usb-drive .lp-usb-body {
|
||||
border: 2px solid var(--bs-body-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .lp-usb-drive .lp-usb-metal {
|
||||
border: 2px solid var(--bs-body-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .lp-usb-drive .lp-usb-hole {
|
||||
background-color: var(--bs-body-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .lp-usb-ctx.active {
|
||||
background-color: var(--bs-default-active-bg-color) !important;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .lp-usb-ctx.active .lp-usb-drive .lp-usb-body {
|
||||
border-color: var(--bs-default-txt-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .lp-usb-ctx.active .lp-usb-drive .lp-usb-metal {
|
||||
border-color: var(--bs-default-txt-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .lp-usb-ctx.active .lp-usb-drive .lp-usb-hole {
|
||||
background-color: var(--bs-default-txt-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .modal-header,
|
||||
[data-bs-theme=dark] .modal-body,
|
||||
[data-bs-theme=dark] .modal-footer
|
||||
{
|
||||
border-color: var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] table tr,
|
||||
[data-bs-theme=dark] table th
|
||||
{
|
||||
border-color: var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .login {
|
||||
/*background-color: #202122;*/
|
||||
background-color: var(--bs-default-body-bg-color);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .login .card {
|
||||
border-color: var(--bs-default-auth-border-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .login .form-control {
|
||||
color: var(--bs-body-bg-color);
|
||||
background-color: var(--bs-default-bg-color);
|
||||
border: 3px solid var(--bs-default-auth-border-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .login label {
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .login input:-webkit-autofill {
|
||||
transition: background-color 5000s ease-in-out 0s;
|
||||
-webkit-text-fill-color: var(--bs-body-color-semi);
|
||||
caret-color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .login .input-group-text {
|
||||
color: var(--bs-body-color-semi);
|
||||
border: 2px solid var(--bs-border-color-translucent) !important;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .login .input-group input {
|
||||
border: 2px solid var(--bs-border-color-translucent) !important;
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .login input::placeholder {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .login .input-group input:focus {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .login .input-group input.input-passwd {
|
||||
border-right: none !important;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .login .form-check-primary .form-check-input:not(:checked):focus {
|
||||
border-color: var(--bs-default-auth-border-color);
|
||||
--bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28255, 255, 255, 0.25%29'/%3e%3c/svg%3e");
|
||||
outline: 0;
|
||||
background-color: var(--bs-default-bg-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .login .form-check-primary .form-check-input:not(:checked):not(:focus) {
|
||||
--bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%2885, 85, 85, 1%29'/%3e%3c/svg%3e");
|
||||
background-color: var(--bs-default-bg-color);
|
||||
border-color: #495057;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .user-icon {
|
||||
font-size: 2.1rem;
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .logout-icon {
|
||||
position: absolute;
|
||||
right: 2rem;
|
||||
font-size: 1.5rem;
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .dashboard .flot-text {
|
||||
color: var(--bs-body-color-semi) !important;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .dashboard .temperature .bar .mask{
|
||||
background: #777;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .dashboard .iface{
|
||||
background: var(--bs-default-bg-color);
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .dashboard .hdmi, .sdi{
|
||||
filter: brightness(70%);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .stream .play-url {
|
||||
background-color: var(--bs-default-bg-color);
|
||||
border-color: var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .push .input-group-text {
|
||||
background-color: transparent;
|
||||
border-color: var(--bs-border-color-translucent);
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .push .dropdown-menu {
|
||||
background-color: transparent;
|
||||
border-color: var(--bs-border-color-translucent);
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
[data-bs-theme=dark] .dropdown-menu:after {
|
||||
border-bottom: 6px solid var(--bs-body-color-semi) !important;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .dropdown-menu table td a {
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .dropdown-menu table td a:hover {
|
||||
background-color: var(--bs-default-active-bg-color);
|
||||
border-color: var(--bs-default-active-bg-color);
|
||||
color: var(--bs-default-txt-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .dropdown-menu table td input {
|
||||
background-color: transparent;
|
||||
border-color: var(--bs-body-color-semi);
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .push .push-bar {
|
||||
background-color: transparent;
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .sys .input-group-text {
|
||||
color: var(--bs-body-color-semi);
|
||||
border: 2px solid var(--bs-border-color-translucent) !important;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .sys .border-right {
|
||||
border-color: var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .output .border-right {
|
||||
border-right: 1px solid var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .sys .snInput {
|
||||
color: var(--bs-body-color-semi);
|
||||
background: transparent;
|
||||
border-bottom: 1px solid var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .sys .snTitle {
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .mix .lp-aspect-ratio .aspect-ratio-content button.btn-default {
|
||||
background-color: var(--bs-default-bg-color);
|
||||
border-color: var(--bs-default-bg-color);
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .record .rec-bar {
|
||||
background-color: transparent;
|
||||
border: 1px solid var(--bs-card-border-color);
|
||||
color: var(--bs-card-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .record .rec-bar .btn-default {
|
||||
background-color: #a8a9aa;
|
||||
border-color: #a8a9aa;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .record .rec-file-title {
|
||||
background-color: transparent;
|
||||
color: var(--bs-card-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .intercom .intercomBtn{
|
||||
border: 4px solid var(--bs-border-color-translucent);
|
||||
background-color: transparent;
|
||||
}
|
|
@ -0,0 +1,444 @@
|
|||
|
||||
[data-bs-theme=default] {
|
||||
--bs-body-color-semi: #adb5bd;
|
||||
--bs-body-bg-semi-2:#191b1e;
|
||||
--bs-light-text-semi: #f8f9fa;
|
||||
--bs-border-color-translucent-semi: rgba(255, 255, 255, 0.15);
|
||||
--bs-border-color: #dee2e6;
|
||||
--bs-body-bg-color: #f0f0f4;
|
||||
--bs-body-bg: #ffffff;
|
||||
|
||||
--bs-default-simplebar-color: #727477;
|
||||
--bs-default-auth-border-color:#495057;
|
||||
--bs-default-body-color:#555;
|
||||
--bs-default-bg-color:#212529;
|
||||
--bs-default-active-bg-color:#ffbb00;
|
||||
--bs-default-acitve-color:#eeaa00;
|
||||
--bs-default-hr-color:#bbbbbb;
|
||||
--bs-default-nav-color:#999999;
|
||||
--bs-default-nav-active-color:#333;
|
||||
--bs-default-slider-color:#fb0;
|
||||
--bs-default-slider-bg-color:#fd5;
|
||||
}
|
||||
|
||||
/* body */
|
||||
[data-bs-theme=default] body {
|
||||
background-color: var(--bs-body-bg-color);
|
||||
color: var(--bs-default-body-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .simplebar-scrollbar:before {
|
||||
background-color: var(--bs-default-simplebar-color);
|
||||
}
|
||||
|
||||
/* sidebar */
|
||||
[data-bs-theme=default] .sidebar-wrapper .sidebar-nav,
|
||||
[data-bs-theme=default] .sidebar-wrapper .sidebar-header,
|
||||
[data-bs-theme=default] .sidebar-wrapper .sidebar-bottom,
|
||||
[data-bs-theme=default] .sidebar-wrapper {
|
||||
background-color: var(--bs-default-bg-color);
|
||||
border-color:var(--bs-border-color-translucent-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .sidebar-wrapper .sidebar-header .logo-name h5 {
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
|
||||
[data-bs-theme=default] .sidebar-wrapper .sidebar-bottom .user-info .user-name {
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .sidebar-wrapper .sidebar-header .sidebar-close {
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .sidebar-wrapper .sidebar-bottom .user-info .user-designation {
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .sidebar-wrapper .sidebar-bottom .dropdown-menu {
|
||||
|
||||
background-color: var(--bs-default-bg-color-2);
|
||||
border-color:var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .sidebar-wrapper .sidebar-bottom .dropdown-menu .dropdown-item {
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .sidebar-wrapper .sidebar-bottom .dropdown-menu .dropdown-item:hover {
|
||||
background-color: var(--bs-default-bg-color);
|
||||
}
|
||||
|
||||
|
||||
[data-bs-theme=default] .sidebar-wrapper .metismenu a {
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .sidebar-wrapper .metismenu .mm-active>a {
|
||||
color: var(--bs-default-active-bg-color);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .sidebar-wrapper .metismenu a .parent-icon {
|
||||
color: var(--bs-body-color-semi);
|
||||
background-color: var(--bs-default-bg-color);
|
||||
border-color:var(--bs-border-color-translucent-semi)
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .sidebar-wrapper .metismenu .mm-active>a .parent-icon,
|
||||
[data-bs-theme=default] .sidebar-wrapper .metismenu a:hover .parent-icon,
|
||||
[data-bs-theme=default] .sidebar-wrapper .metismenu a:focus .parent-icon,
|
||||
[data-bs-theme=default] .sidebar-wrapper .metismenu a:active .parent-icon {
|
||||
color: #ffffff;
|
||||
text-decoration: none;
|
||||
background: var(--bs-default-active-bg-color);
|
||||
border-color: var(--bs-default-active-bg-color);
|
||||
transition: ease-out .3s;
|
||||
}
|
||||
|
||||
|
||||
[data-bs-theme=default] .sidebar-wrapper .metismenu ul {
|
||||
background-color: var(--bs-default-bg-color);
|
||||
}
|
||||
|
||||
/*header*/
|
||||
[data-bs-theme=default] .top-header .navbar {
|
||||
background-color: #ffffff;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .top-header .navbar .top-right-menu .nav-item .nav-link,
|
||||
[data-bs-theme=default] .top-header .navbar .btn-toggle-menu {
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #dee2e6;
|
||||
color: #212529;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .search-bar input {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
/* button */
|
||||
[data-bs-theme=default] .btn-default {
|
||||
background-color: #ffffff;
|
||||
border-color: #cccccc;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
padding: 6px 12px;
|
||||
white-space: nowrap;
|
||||
border-radius: 4px;
|
||||
line-height: 1.2;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .btn-primary {
|
||||
background-color: var(--bs-default-active-bg-color);
|
||||
border-color: var(--bs-default-active-bg-color);
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
padding: 6px 12px;
|
||||
white-space: nowrap;
|
||||
border-radius: 4px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .btn-primary.btn-sm {
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
padding: 5px 10px;
|
||||
white-space: nowrap;
|
||||
border-radius: 4px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .btn-primary.btn-df {
|
||||
padding: 0.375rem 0.75rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .btn-primary:hover {
|
||||
background-color: var(--bs-default-acitve-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .btn-primary:active {
|
||||
border-color: var(--bs-default-acitve-color);
|
||||
background-color: var(--bs-default-acitve-color);
|
||||
}
|
||||
|
||||
/* switch */
|
||||
[data-bs-theme=default] .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary {
|
||||
background-color: var(--bs-default-active-bg-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .bootstrap-switch-small {
|
||||
width: 66px !important;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .bootstrap-switch-small .bootstrap-switch-container {
|
||||
width: 104px !important;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .bootstrap-switch-small .bootstrap-switch-container .bootstrap-switch-label {
|
||||
width: 32px !important;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .bootstrap-switch-normal {
|
||||
width: 90px !important;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .bootstrap-switch-normal .bootstrap-switch-container {
|
||||
width: 140px !important;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .bootstrap-switch-normal .bootstrap-switch-container .bootstrap-switch-label {
|
||||
width: 40px !important;
|
||||
}
|
||||
|
||||
|
||||
[data-bs-theme=default] .bootstrap-switch.bootstrap-switch-focused {
|
||||
border-color: transparent;
|
||||
/*box-shadow: none;*/
|
||||
/*border-color: #66afe9;*/
|
||||
outline: 0;
|
||||
-webkit-box-shadow: inset 0 1px 1px var(--bs-default-acitve-color), 0 0 8px var(--bs-default-acitve-color);
|
||||
box-shadow: inset 0 1px 1px var(--bs-default-acitve-color), 0 0 8px var(--bs-default-acitve-color);
|
||||
}
|
||||
|
||||
/* nav-tab */
|
||||
[data-bs-theme=default] .nav-primary.nav-tabs .nav-link {
|
||||
color: var(--bs-default-nav-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .nav-primary.nav-tabs .nav-link.active {
|
||||
transition: all .2s ease;
|
||||
color: var(--bs-default-nav-active-color)!important;
|
||||
padding-top:8px!important;
|
||||
border-radius: 0;
|
||||
background: #fff;
|
||||
border-color: transparent;
|
||||
border-top: 4px solid var(--bs-default-active-bg-color) !important;
|
||||
border-left: 1px solid rgba(0,0,0,0.175);
|
||||
border-right: 1px solid rgba(0,0,0,0.175);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .nav-primary.nav-tabs .nav-link:hover {
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .tab-content {
|
||||
background-color: var(--bs-body-bg);
|
||||
color: var(--bs-default-body-color);
|
||||
border-bottom-left-radius: 6px;
|
||||
border-bottom-right-radius: 6px;
|
||||
border-left: 1px solid rgba(0,0,0,0.175);
|
||||
border-bottom: 1px solid rgba(0,0,0,0.175);
|
||||
border-right: 1px solid rgba(0,0,0,0.175);
|
||||
}
|
||||
|
||||
/* hr */
|
||||
[data-bs-theme=default] hr {
|
||||
color: var(--bs-default-hr-color);
|
||||
margin:0.6rem 0;
|
||||
}
|
||||
|
||||
/* input slect */
|
||||
[data-bs-theme=default] .form-select,
|
||||
[data-bs-theme=default] .form-control {
|
||||
border-color: #dee2e6;
|
||||
color: #555;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* pace-progress */
|
||||
[data-bs-theme=default] .pace .pace-progress {
|
||||
background: var(--bs-default-acitve-color);
|
||||
}
|
||||
|
||||
|
||||
/* slider */
|
||||
|
||||
[data-bs-theme=default] .slider-wrap,
|
||||
[data-bs-theme=default] .slider-wrap .noUi-handle {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .slider-wrap .noUi-handle::before, .slider-wrap .noUi-handle::after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .slider-wrap.noUi-handle .noUi-touch-area {
|
||||
border: 1px solid transparent;
|
||||
position: absolute;
|
||||
top: -10px;
|
||||
left: -10px;
|
||||
right: -10px;
|
||||
bottom: -10px;
|
||||
width: auto;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .slider-wrap.noUi-handle:hover .noUi-touch-area {
|
||||
border: 1px dashed #7f7f7f;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .slider-wrap {
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .slider-wrap.noUi-target {
|
||||
border : none;
|
||||
box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .slider-wrap .noUi-connects {
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .slider-wrap .noUi-connect {
|
||||
background: var(--bs-default-slider-bg-color);
|
||||
border-color: var(--bs-default-slider-bg-color);
|
||||
box-shadow: inset 0 -1px 0 rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .slider-wrap .noUi-handle {
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
top: -5px;
|
||||
right: -10px; /* half the width */
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
background-color: var(--bs-default-slider-color);
|
||||
border-color: var(--bs-default-slider-color);
|
||||
}
|
||||
|
||||
/*checkbox*/
|
||||
[data-bs-theme=default] .form-check-primary .form-check-input:checked {
|
||||
background-color: var(--bs-default-acitve-color);
|
||||
border-color: var(--bs-default-acitve-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .form-check-primary .form-check-input:not(:checked):focus,
|
||||
[data-bs-theme=default] .form-check-primary .form-check-input:checked:focus
|
||||
{
|
||||
border-color: var(--bs-default-acitve-color);
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 .25rem rgba(255, 193, 7, 0.25)
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .jconfirm.jconfirm-white .jconfirm-bg,
|
||||
[data-bs-theme=default] .jconfirm.jconfirm-light .jconfirm-bg {
|
||||
background-color: #c2c2c2;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .lp-usb-ctx.active {
|
||||
background-color: var(--bs-default-active-bg-color) !important;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .lp-usb-ctx.active .lp-usb-drive .lp-usb-body {
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .lp-usb-ctx.active .lp-usb-drive .lp-usb-metal {
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .lp-usb-ctx.active .lp-usb-drive .lp-usb-hole {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .login {
|
||||
background-color: var(--bs-body-bg-color);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .login .card {
|
||||
border-color: var(--bs-default-auth-border-color);
|
||||
background: #333;
|
||||
color: #bbb;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .login .card .form-control {
|
||||
background-color: var(--bs-body-bg-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .login input:-webkit-autofill {
|
||||
transition: background-color 5000s ease-in-out 0s;
|
||||
-webkit-text-fill-color: var(--bs-body-color-semi);
|
||||
caret-color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .login .input-group-text {
|
||||
color: var(--bs-body-color-semi);
|
||||
background-color: var(--bs-body-bg-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .login ::placeholder {
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .login input:focus {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .login .form-check-primary .form-check-input:not(:checked):focus {
|
||||
border-color: var(--bs-default-auth-border-color);
|
||||
--bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28255, 255, 255, 0.25%29'/%3e%3c/svg%3e");
|
||||
outline: 0;
|
||||
background-color: var(--bs-default-bg-color);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .login .form-check-primary .form-check-input:not(:checked):not(:focus) {
|
||||
--bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%2885, 85, 85, 1%29'/%3e%3c/svg%3e");
|
||||
background-color: var(--bs-default-bg-color);
|
||||
border-color: #495057;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .user-icon {
|
||||
font-size: 2.1rem;
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .logout-icon {
|
||||
position: absolute;
|
||||
right: 2rem;
|
||||
font-size: 1.5rem;
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .dashboard .temperature .bar .mask{
|
||||
background: #777;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .dashboard .iface{
|
||||
background: #555;
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .record .rec-file-title {
|
||||
background-color: #555;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .intercom .intercomBtn{
|
||||
border: 4px solid #999;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .sys .snInput {
|
||||
border-bottom: 1px solid #ccc;
|
||||
color: var(--bs-body-color-semi);
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .sys .snTitle {
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
[data-bs-theme=default] .output .border-right {
|
||||
border-right: 1px solid var(--bs-border-color-translucent);
|
||||
}
|
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 20 KiB |
|
@ -0,0 +1,12 @@
|
|||
|
||||
import { queryData } from "./lp.utils.js"
|
||||
|
||||
Promise.all([queryData("config/lang.json"),queryData("config/theme_standard.json")]).then(config => {
|
||||
const [ languageConf,themeConf ] = config;
|
||||
const html = document.querySelector('html');
|
||||
html.setAttribute('data-bs-language', languageConf.lang);
|
||||
html.setAttribute('data-bs-theme', themeConf.used);
|
||||
document.body.style.display = "block";
|
||||
html.dispatchEvent(new Event("loaded"));
|
||||
});
|
||||
|
|
@ -0,0 +1,333 @@
|
|||
import JsonRpcClient from '../plugins/jsonrpc/jquery.jsonrpc.js';
|
||||
import axios from '../plugins/axios/axios.esm.js';
|
||||
import Lobibox from '../plugins/notifications/js/lobibox.min.js'
|
||||
import JqueryConfirm from '../plugins/confirm/js/jquery-confirm.esm.js'
|
||||
|
||||
export const getUrlParam = (key) => {
|
||||
let param = "";
|
||||
let query = window.location.search.substring(1);
|
||||
let vars = query.split("&");
|
||||
for (let i=0;i<vars.length;i++) {
|
||||
let pair = vars[i].split("=");
|
||||
if(pair[0] === key)
|
||||
param = pair[1]
|
||||
}
|
||||
return param;
|
||||
}
|
||||
|
||||
export const updateSysLanguage = param => {
|
||||
if(param) {
|
||||
func("/conf/updateLangConf", param).then(result => {
|
||||
if(result.status === "success") {
|
||||
const html = document.querySelector('html');
|
||||
html.setAttribute('data-bs-language', param);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//size mini normal large
|
||||
export const alertMsg = (message, type = "success",delay = 5000,size = "mini") => {
|
||||
|
||||
let icon = "fa-solid fa-circle-check";
|
||||
if(type === "error")
|
||||
icon = "fa-solid fa-circle-xmark";
|
||||
if(type === "info")
|
||||
icon = "fa-solid fa-circle-info ";
|
||||
if(type === "warning")
|
||||
icon = "fa-solid fa-triangle-exclamation";
|
||||
|
||||
return Lobibox.notify(type, {
|
||||
pauseDelayOnHover: true,
|
||||
continueDelayOnInactiveTab: false,
|
||||
size: size,
|
||||
sound: false,
|
||||
position: 'top right',
|
||||
icon: icon,
|
||||
msg: message,
|
||||
delay: delay,
|
||||
});
|
||||
}
|
||||
|
||||
export const confirm = (options) => {
|
||||
const jc = new JqueryConfirm();
|
||||
return jc.confirm(options);
|
||||
}
|
||||
|
||||
export const request = (url) => {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', url, false);
|
||||
xhr.send();
|
||||
|
||||
if (xhr.status === 200) {
|
||||
return JSON.parse(xhr.responseText);
|
||||
} else {
|
||||
throw new Error(xhr.statusText);
|
||||
}
|
||||
}
|
||||
|
||||
export const queryData = (url,options= {}) => {
|
||||
return new Promise((resolve,reject)=>{
|
||||
axios.get(url,options)
|
||||
.then(response => {
|
||||
resolve(response.data);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('请求出错:', error);
|
||||
reject(error);
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
export const func = (url,data = []) => {
|
||||
return new Promise((resolve,reject)=>{
|
||||
axios.post('/link/relay.php', {url:url,data:data})
|
||||
.then(response => {
|
||||
resolve(response.data);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('请求出错:', error);
|
||||
reject(error);
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
export const axios_post = (url,data = []) => {
|
||||
return new Promise((resolve,reject)=>{
|
||||
axios.post(url, data)
|
||||
.then(response => {
|
||||
resolve(response.data);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('请求出错:', error);
|
||||
reject(error);
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
//encoder
|
||||
export const rpc = (func, params = []) => {
|
||||
return new Promise((resolve,reject)=>{
|
||||
let jsonrpc = new JsonRpcClient({ ajaxUrl: '/RPC' });
|
||||
jsonrpc.call(func, params, data => { resolve(data); }, error =>{ console.log(error);reject(error); });
|
||||
})
|
||||
}
|
||||
|
||||
//netManager
|
||||
export const rpc2 = (func, params = []) => {
|
||||
return new Promise((resolve,reject)=>{
|
||||
let jsonrpc = new JsonRpcClient({ ajaxUrl: '/RPC2' });
|
||||
jsonrpc.call(func, params, data => { resolve(data); }, error =>{ console.log(error);reject(error); });
|
||||
})
|
||||
}
|
||||
|
||||
//port
|
||||
export const rpc3 = (func, params = []) => {
|
||||
return new Promise((resolve,reject)=>{
|
||||
let jsonrpc = new JsonRpcClient({ ajaxUrl: '/RPC3' });
|
||||
jsonrpc.call(func, params, data => { resolve(data); }, error =>{ console.log(error);reject(error); });
|
||||
})
|
||||
}
|
||||
|
||||
//mqtt
|
||||
export const rpc4 = (func, params = []) => {
|
||||
return new Promise((resolve,reject)=>{
|
||||
let jsonrpc = new JsonRpcClient({ ajaxUrl: '/RPC4' });
|
||||
jsonrpc.call(func, params, data => { resolve(data); }, error =>{ console.log(error);reject(error); });
|
||||
})
|
||||
}
|
||||
|
||||
//onvif
|
||||
export const rpc5 = (func, params = []) => {
|
||||
return new Promise((resolve,reject)=>{
|
||||
let jsonrpc = new JsonRpcClient({ ajaxUrl: '/RPC5' });
|
||||
jsonrpc.call(func, params, data => { resolve(data); }, error =>{ console.log(error);reject(error); });
|
||||
})
|
||||
}
|
||||
|
||||
// monitor
|
||||
export const rpc6 = (func, params = []) => {
|
||||
return new Promise((resolve,reject)=>{
|
||||
let jsonrpc = new JsonRpcClient({ ajaxUrl: '/RPC6' });
|
||||
jsonrpc.call(func, params, data => { resolve(data); }, error =>{ console.log(error);reject(error); });
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export const checkFileExists = (url) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('HEAD', url);
|
||||
xhr.onload = () => {
|
||||
if (xhr.status === 200) {
|
||||
resolve(true);
|
||||
} else {
|
||||
resolve(false);
|
||||
}
|
||||
};
|
||||
xhr.onerror = () => {
|
||||
reject(new Error('请求出错'));
|
||||
};
|
||||
xhr.send();
|
||||
});
|
||||
}
|
||||
|
||||
export const extend = (target, ...sources) => {
|
||||
if (!target) return {};
|
||||
|
||||
sources.forEach(source => {
|
||||
if (source) {
|
||||
Object.assign(target, source);
|
||||
}
|
||||
});
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
export const clearReactiveObject = (reactiveObj) => {
|
||||
const keys = Object.keys(reactiveObj);
|
||||
keys.forEach((key) => {
|
||||
delete reactiveObj[key];
|
||||
});
|
||||
};
|
||||
|
||||
export const clearReactiveArray = (reactiveArray) => {
|
||||
reactiveArray.splice(0);
|
||||
};
|
||||
|
||||
export const deepCopy = (obj) => JSON.parse(JSON.stringify(obj));
|
||||
|
||||
export const popover = (ele,param) => {
|
||||
if(ele === null || ele === undefined)
|
||||
return {};
|
||||
if(param.content.includes("<cn>")) {
|
||||
const html = document.querySelector('html');
|
||||
let lang = html.getAttribute('data-bs-language');
|
||||
if(lang === null)
|
||||
lang = "cn";
|
||||
const regex = new RegExp(`<${lang}>(.*?)<\/${lang}>`);
|
||||
param.content = param.content.match(regex)[1];
|
||||
}
|
||||
return new bootstrap.Popover(ele, param)
|
||||
}
|
||||
|
||||
export const formatDate = (fmt,date = new Date()) => {
|
||||
let o = {
|
||||
"M+": date.getMonth() + 1,
|
||||
"d+": date.getDate(),
|
||||
"h+": date.getHours(),
|
||||
"m+": date.getMinutes(),
|
||||
"s+": date.getSeconds(),
|
||||
"q+": Math.floor( ( date.getMonth() + 3 ) / 3 ),
|
||||
"S": date.getMilliseconds()
|
||||
};
|
||||
if ( /(y+)/.test( fmt ) ) fmt = fmt.replace( RegExp.$1, ( date.getFullYear() + "" ).substr( 4 - RegExp.$1.length ) );
|
||||
for ( let k in o )
|
||||
if ( new RegExp( "(" + k + ")" ).test( fmt ) ) fmt = fmt.replace( RegExp.$1, ( RegExp.$1.length == 1 ) ? ( o[ k ] ) : ( ( "00" + o[ k ] ).substr( ( "" + o[ k ] ).length ) ) );
|
||||
return fmt;
|
||||
}
|
||||
|
||||
export const deepEqualIgnoreProps = (obj1, obj2, ignoreProps) => {
|
||||
if (obj1 === obj2) {
|
||||
return true;
|
||||
}
|
||||
if (typeof obj1 !== 'object' || typeof obj2 !== 'object' || obj1 === null || obj2 === null) {
|
||||
return false;
|
||||
}
|
||||
const keys1 = Object.keys(obj1).filter(key => !ignoreProps.includes(key));
|
||||
const keys2 = Object.keys(obj2).filter(key => !ignoreProps.includes(key));
|
||||
if (keys1.length !== keys2.length) {
|
||||
return false;
|
||||
}
|
||||
for (const key of keys1) {
|
||||
if (!keys2.includes(key) || !deepEqualIgnoreProps(obj1[key], obj2[key], ignoreProps)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
export const rebootConfirm = (msg) => {
|
||||
confirm( {
|
||||
title: '<cn>重启</cn><en>Reboot</en>',
|
||||
content: '<cn>'+msg+'</cn><en>Reboot immediately?</en>',
|
||||
buttons: {
|
||||
ok: {
|
||||
text: "<cn>确认重启</cn><en>Confirm</en>",
|
||||
btnClass: 'btn-primary',
|
||||
keys: [ 'enter' ],
|
||||
action: function () {
|
||||
func("/system/systemReboot");
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
text: "<cn>取消</cn><en>Cancel</en>",
|
||||
action: function () {
|
||||
console.log( 'the user clicked cancel' );
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
export const resetConfirm = () => {
|
||||
confirm( {
|
||||
title: '<cn>还原</cn><en>Reset</en>',
|
||||
content: '<cn>是否还原全部设置?</cn><en>Reset all config to default and reboot immediately?</en>',
|
||||
buttons: {
|
||||
ok: {
|
||||
text: "<cn>确认</cn><en>Confirm</en>",
|
||||
btnClass: 'btn-primary',
|
||||
keys: [ 'enter' ],
|
||||
action: function () {
|
||||
func("/system/systemReset");
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
text: "<cn>取消</cn><en>Cancel</en>",
|
||||
action: function () {
|
||||
console.log( 'the user clicked cancel' );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
export const splitArray = (array,count) => {
|
||||
return Array.from({ length: Math.ceil(array.length / count) }, (_, index) =>
|
||||
array.slice(index * count, index * count + count)
|
||||
);
|
||||
}
|
||||
|
||||
export const isEmpty = str => {
|
||||
return (!str || str.trim() === "");
|
||||
}
|
||||
|
||||
export const swap = (array, index1, index2) => {
|
||||
const temp = array[index1];
|
||||
array[index1] = array[index2];
|
||||
array[index2] = temp;
|
||||
console.log(array,index1,index2);
|
||||
}
|
||||
|
||||
export const formatTime = (msec, format="hh:mm:ss") => {
|
||||
const seconds = Math.floor((msec / 1000) % 60);
|
||||
const minutes = Math.floor((msec / (1000 * 60)) % 60);
|
||||
const hours = Math.floor((msec / (1000 * 60 * 60)) % 24);
|
||||
const days = Math.floor(msec / (1000 * 60 * 60 * 24));
|
||||
|
||||
const formattedTime = format
|
||||
.replace('dd', String(days).padStart(2, '0'))
|
||||
.replace('hh', String(hours).padStart(2, '0'))
|
||||
.replace('mm', String(minutes).padStart(2, '0'))
|
||||
.replace('ss', String(seconds).padStart(2, '0'));
|
||||
|
||||
return formattedTime;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
// import * as vue from '../plugins/vue/vue.esm.js'
|
||||
import * as vue from '../plugins/vue/vue.esm.prod.js'
|
||||
export default vue;
|
|
@ -0,0 +1,185 @@
|
|||
import vue from "./vue.build.js";
|
||||
const {onMounted, ref, toRefs, watchEffect} = vue;
|
||||
|
||||
export const wifiFlagComponent = {
|
||||
template: `<div>
|
||||
<div v-if="icon === 'wifi'">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-wifi" :width="width" :height="height" viewBox="0 0 24 24" :stroke-width="strokeWidth" :stroke="stroke" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 18l.01 0" />
|
||||
<path d="M9.172 15.172a4 4 0 0 1 5.656 0" />
|
||||
<path d="M6.343 12.343a8 8 0 0 1 11.314 0" />
|
||||
<path d="M3.515 9.515c4.686 -4.687 12.284 -4.687 17 0" />
|
||||
</svg>
|
||||
</div>
|
||||
<div v-if="icon === 'wifi-1'">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-wifi" :width="width" :height="height" viewBox="0 0 24 24" :stroke-width="strokeWidth" :stroke="stroke" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 18l.01 0" :stroke="color"/>
|
||||
<path d="M9.172 15.172a4 4 0 0 1 5.656 0"/>
|
||||
<path d="M6.343 12.343a8 8 0 0 1 11.314 0"/>
|
||||
<path d="M3.515 9.515c4.686 -4.687 12.284 -4.687 17 0" />
|
||||
</svg>
|
||||
</div>
|
||||
<div v-if="icon === 'wifi-2'">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-wifi" :width="width" :height="height" viewBox="0 0 24 24" :stroke-width="strokeWidth" :stroke="stroke" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 18l.01 0" :stroke="color"/>
|
||||
<path d="M9.172 15.172a4 4 0 0 1 5.656 0" :stroke="color"/>
|
||||
<path d="M6.343 12.343a8 8 0 0 1 11.314 0"/>
|
||||
<path d="M3.515 9.515c4.686 -4.687 12.284 -4.687 17 0" />
|
||||
</svg>
|
||||
</div>
|
||||
<div v-if="icon === 'wifi-3'">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-wifi" :width="width" :height="height" viewBox="0 0 24 24" :stroke-width="strokeWidth" :stroke="stroke" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 18l.01 0" :stroke="color"/>
|
||||
<path d="M9.172 15.172a4 4 0 0 1 5.656 0" :stroke="color"/>
|
||||
<path d="M6.343 12.343a8 8 0 0 1 11.314 0" :stroke="color"/>
|
||||
<path d="M3.515 9.515c4.686 -4.687 12.284 -4.687 17 0" />
|
||||
</svg>
|
||||
</div>
|
||||
<div v-if="icon === 'wifi-4'">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-wifi" :width="width" :height="height" viewBox="0 0 24 24" :stroke-width="strokeWidth" :stroke="stroke" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 18l.01 0" :stroke="color"/>
|
||||
<path d="M9.172 15.172a4 4 0 0 1 5.656 0" :stroke="color"/>
|
||||
<path d="M6.343 12.343a8 8 0 0 1 11.314 0" :stroke="color"/>
|
||||
<path d="M3.515 9.515c4.686 -4.687 12.284 -4.687 17 0" :stroke="color"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div v-if="icon === 'wifi-off'">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-wifi-off" :width="width" :height="height" viewBox="0 0 24 24" :stroke-width="strokeWidth" :stroke="stroke" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 18l.01 0" />
|
||||
<path d="M9.172 15.172a4 4 0 0 1 5.656 0" />
|
||||
<path d="M6.343 12.343a7.963 7.963 0 0 1 3.864 -2.14m4.163 .155a7.965 7.965 0 0 1 3.287 2" />
|
||||
<path d="M3.515 9.515a12 12 0 0 1 3.544 -2.455m3.101 -.92a12 12 0 0 1 10.325 3.374" />
|
||||
<path d="M3 3l18 18" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>`,
|
||||
props: {
|
||||
icon: {
|
||||
type: String,
|
||||
default: "wifi"
|
||||
},
|
||||
width: {
|
||||
type: Number,
|
||||
default: 20
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 20
|
||||
},
|
||||
stroke: {
|
||||
type: String,
|
||||
default: "#2c3e50"
|
||||
},
|
||||
strokeWidth: {
|
||||
type: Number,
|
||||
default: 2
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: "#cccccc"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const antenanFlagComponent = {
|
||||
template: `<div>
|
||||
<div v-if="icon === 'antenan'">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-antenna-bars-5" :width="width" :height="height" viewBox="0 0 24 24" :stroke-width="strokeWidth" :stroke="stroke" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M6 18l0 -3" />
|
||||
<path d="M10 18l0 -6" />
|
||||
<path d="M14 18l0 -9" />
|
||||
<path d="M18 18l0 -12" />
|
||||
</svg>
|
||||
</div>
|
||||
<div v-if="icon === 'antenan-0'">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-antenna-bars-5" :width="width" :height="height" viewBox="0 0 24 24" :stroke-width="strokeWidth" :stroke="stroke" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M6 18l0 -3" />
|
||||
<path d="M10 18l0 -6" />
|
||||
<path d="M14 18l0 -9" />
|
||||
<path d="M18 18l0 -12" />
|
||||
</svg>
|
||||
</div>
|
||||
<div v-if="icon === 'antenan-1'">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-antenna-bars-5" :width="width" :height="height" viewBox="0 0 24 24" :stroke-width="strokeWidth" :stroke="stroke" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M6 18l0 -3" :stroke="color"/>
|
||||
<path d="M10 18l0 -6"/>
|
||||
<path d="M14 18l0 -9"/>
|
||||
<path d="M18 18l0 -12" />
|
||||
</svg>
|
||||
</div>
|
||||
<div v-if="icon === 'antenan-2'">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-antenna-bars-5" :width="width" :height="height" viewBox="0 0 24 24" :stroke-width="strokeWidth" :stroke="stroke" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M6 18l0 -3" :stroke="color"/>
|
||||
<path d="M10 18l0 -6" :stroke="color"/>
|
||||
<path d="M14 18l0 -9" />
|
||||
<path d="M18 18l0 -12" />
|
||||
</svg>
|
||||
</div>
|
||||
<div v-if="icon === 'antenan-3'">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-antenna-bars-5" :width="width" :height="height" viewBox="0 0 24 24" :stroke-width="strokeWidth" :stroke="stroke" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M6 18l0 -3" :stroke="color"/>
|
||||
<path d="M10 18l0 -6" :stroke="color"/>
|
||||
<path d="M14 18l0 -9" :stroke="color"/>
|
||||
<path d="M18 18l0 -12" />
|
||||
</svg>
|
||||
</div>
|
||||
<div v-if="icon === 'antenan-4'">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-antenna-bars-5" :width="width" :height="height" viewBox="0 0 24 24" :stroke-width="strokeWidth" :stroke="stroke" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M6 18l0 -3" :stroke="color"/>
|
||||
<path d="M10 18l0 -6" :stroke="color"/>
|
||||
<path d="M14 18l0 -9" :stroke="color"/>
|
||||
<path d="M18 18l0 -12" :stroke="color"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div v-if="icon === 'antenan-off'">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-antenna-bars-off" :width="width" :height="height" viewBox="0 0 24 24" :stroke-width="strokeWidth" :stroke="stroke" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M6 18v-3" />
|
||||
<path d="M10 18v-6" />
|
||||
<path d="M14 18v-4" />
|
||||
<path d="M14 10v-1" />
|
||||
<path d="M18 14v-8" />
|
||||
<path d="M3 3l18 18" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>`,
|
||||
props: {
|
||||
icon: {
|
||||
type: String,
|
||||
default: "antenan"
|
||||
},
|
||||
width: {
|
||||
type: Number,
|
||||
default: 20
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 20
|
||||
},
|
||||
stroke: {
|
||||
type: String,
|
||||
default: "#2c3e50"
|
||||
},
|
||||
strokeWidth: {
|
||||
type: Number,
|
||||
default: 2
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: "#cccccc"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,702 @@
|
|||
$(function () {
|
||||
"use strict";
|
||||
|
||||
|
||||
// chart 1
|
||||
var options = {
|
||||
series: [{
|
||||
name: 'Likes',
|
||||
data: [14, 3, 10, 9, 29, 19, 22, 9, 12, 7, 19, 5]
|
||||
}],
|
||||
chart: {
|
||||
foreColor: '#9ba7b2',
|
||||
height: 360,
|
||||
type: 'line',
|
||||
zoom: {
|
||||
enabled: false
|
||||
},
|
||||
toolbar: {
|
||||
show: true
|
||||
},
|
||||
dropShadow: {
|
||||
enabled: true,
|
||||
top: 3,
|
||||
left: 14,
|
||||
blur: 4,
|
||||
opacity: 0.10,
|
||||
}
|
||||
},
|
||||
stroke: {
|
||||
width: 5,
|
||||
curve: 'smooth'
|
||||
},
|
||||
grid: {
|
||||
borderColor: 'rgba(255, 255, 255, 0.15)',
|
||||
strokeDashArray: 4,
|
||||
yaxis: {
|
||||
lines: {
|
||||
show: true
|
||||
}
|
||||
}
|
||||
},
|
||||
xaxis: {
|
||||
//type: 'datetime',
|
||||
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
||||
},
|
||||
title: {
|
||||
text: 'Line Chart',
|
||||
align: 'left',
|
||||
style: {
|
||||
fontSize: "16px",
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
fill: {
|
||||
type: 'gradient',
|
||||
gradient: {
|
||||
shade: 'light',
|
||||
gradientToColors: ['#3461ff'],
|
||||
shadeIntensity: 1,
|
||||
type: 'horizontal',
|
||||
opacityFrom: 1,
|
||||
opacityTo: 1,
|
||||
stops: [0, 100, 100, 100]
|
||||
},
|
||||
},
|
||||
markers: {
|
||||
size: 4,
|
||||
colors: ["#3461ff"],
|
||||
strokeColors: "#fff",
|
||||
strokeWidth: 2,
|
||||
hover: {
|
||||
size: 7,
|
||||
}
|
||||
},
|
||||
colors: ["#3461ff"],
|
||||
yaxis: {
|
||||
title: {
|
||||
text: 'Engagement',
|
||||
},
|
||||
}
|
||||
};
|
||||
var chart = new ApexCharts(document.querySelector("#chart1"), options);
|
||||
chart.render();
|
||||
|
||||
|
||||
// chart 2
|
||||
var optionsLine = {
|
||||
chart: {
|
||||
foreColor: '#9ba7b2',
|
||||
height: 360,
|
||||
type: 'line',
|
||||
zoom: {
|
||||
enabled: false
|
||||
},
|
||||
dropShadow: {
|
||||
enabled: true,
|
||||
top: 3,
|
||||
left: 2,
|
||||
blur: 4,
|
||||
opacity: 0.1,
|
||||
}
|
||||
},
|
||||
stroke: {
|
||||
curve: 'smooth',
|
||||
width: 5
|
||||
},
|
||||
colors: ["#e72e2e", '#0c971a'],
|
||||
series: [{
|
||||
name: "Music",
|
||||
data: [1, 15, 56, 20, 33, 27, 15, 56, 20, 56]
|
||||
}, {
|
||||
name: "Photos",
|
||||
data: [30, 33, 21, 42, 30, 33, 21, 42, 19, 32]
|
||||
}],
|
||||
title: {
|
||||
text: 'Multiline Chart',
|
||||
align: 'left',
|
||||
offsetY: 25,
|
||||
offsetX: 20
|
||||
},
|
||||
subtitle: {
|
||||
text: 'Statistics',
|
||||
offsetY: 55,
|
||||
offsetX: 20
|
||||
},
|
||||
markers: {
|
||||
size: 4,
|
||||
strokeWidth: 0,
|
||||
hover: {
|
||||
size: 7
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
borderColor: 'rgba(255, 255, 255, 0.15)',
|
||||
strokeDashArray: 4,
|
||||
yaxis: {
|
||||
lines: {
|
||||
show: true
|
||||
}
|
||||
}
|
||||
},
|
||||
//labels: ['01/15/2002', '01/16/2002', '01/17/2002', '01/18/2002', '01/19/2002', '01/20/2002'],
|
||||
xaxis: {
|
||||
//type: 'datetime',
|
||||
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct'],
|
||||
},
|
||||
legend: {
|
||||
position: 'top',
|
||||
horizontalAlign: 'right',
|
||||
offsetY: -20
|
||||
}
|
||||
}
|
||||
var chartLine = new ApexCharts(document.querySelector('#chart2'), optionsLine);
|
||||
chartLine.render();
|
||||
|
||||
|
||||
// chart 3
|
||||
var options = {
|
||||
series: [{
|
||||
name: 'series1',
|
||||
data: [31, 40, 68, 31, 92, 55, 100]
|
||||
}, {
|
||||
name: 'series2',
|
||||
data: [11, 82, 45, 80, 34, 52, 41]
|
||||
}],
|
||||
chart: {
|
||||
foreColor: '#9ba7b2',
|
||||
height: 360,
|
||||
type: 'area',
|
||||
zoom: {
|
||||
enabled: false
|
||||
},
|
||||
toolbar: {
|
||||
show: true
|
||||
},
|
||||
},
|
||||
colors: ["#0d6efd", '#20c997'],
|
||||
title: {
|
||||
text: 'Area Chart',
|
||||
align: 'left',
|
||||
style: {
|
||||
fontSize: "16px",
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
grid: {
|
||||
borderColor: 'rgba(255, 255, 255, 0.15)',
|
||||
strokeDashArray: 4,
|
||||
yaxis: {
|
||||
lines: {
|
||||
show: true
|
||||
}
|
||||
}
|
||||
},
|
||||
stroke: {
|
||||
curve: 'smooth'
|
||||
},
|
||||
xaxis: {
|
||||
type: 'datetime',
|
||||
categories: ["2018-09-19T00:00:00.000Z", "2018-09-19T01:30:00.000Z", "2018-09-19T02:30:00.000Z", "2018-09-19T03:30:00.000Z", "2018-09-19T04:30:00.000Z", "2018-09-19T05:30:00.000Z", "2018-09-19T06:30:00.000Z"]
|
||||
},
|
||||
tooltip: {
|
||||
x: {
|
||||
format: 'dd/MM/yy HH:mm'
|
||||
},
|
||||
},
|
||||
};
|
||||
var chart = new ApexCharts(document.querySelector("#chart3"), options);
|
||||
chart.render();
|
||||
|
||||
|
||||
|
||||
// chart 4
|
||||
var options = {
|
||||
series: [{
|
||||
name: 'Net Profit',
|
||||
data: [44, 55, 57, 56, 61, 58, 63, 60, 66]
|
||||
}, {
|
||||
name: 'Revenue',
|
||||
data: [76, 85, 101, 98, 87, 105, 91, 114, 94]
|
||||
}, {
|
||||
name: 'Free Cash Flow',
|
||||
data: [35, 41, 36, 26, 45, 48, 52, 53, 41]
|
||||
}],
|
||||
chart: {
|
||||
foreColor: '#9ba7b2',
|
||||
type: 'bar',
|
||||
height: 360
|
||||
},
|
||||
plotOptions: {
|
||||
bar: {
|
||||
horizontal: false,
|
||||
columnWidth: '55%',
|
||||
endingShape: 'rounded'
|
||||
},
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
stroke: {
|
||||
show: true,
|
||||
width: 2,
|
||||
colors: ['transparent']
|
||||
},
|
||||
title: {
|
||||
text: 'Column Chart',
|
||||
align: 'left',
|
||||
style: {
|
||||
fontSize: '14px'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
borderColor: 'rgba(255, 255, 255, 0.15)',
|
||||
strokeDashArray: 4,
|
||||
yaxis: {
|
||||
lines: {
|
||||
show: true
|
||||
}
|
||||
}
|
||||
},
|
||||
colors: ["#6184ff", '#3461ff', '#c4d1ff'],
|
||||
xaxis: {
|
||||
categories: ['Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct'],
|
||||
},
|
||||
yaxis: {
|
||||
title: {
|
||||
text: '$ (thousands)'
|
||||
}
|
||||
},
|
||||
fill: {
|
||||
opacity: 1
|
||||
},
|
||||
tooltip: {
|
||||
y: {
|
||||
formatter: function (val) {
|
||||
return "$ " + val + " thousands"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var chart = new ApexCharts(document.querySelector("#chart4"), options);
|
||||
chart.render();
|
||||
|
||||
|
||||
// chart 5
|
||||
var options = {
|
||||
series: [{
|
||||
data: [400, 430, 448, 470, 540, 580, 690, 610, 800, 980]
|
||||
}],
|
||||
chart: {
|
||||
foreColor: '#9ba7b2',
|
||||
type: 'bar',
|
||||
height: 350
|
||||
},
|
||||
colors: ["#f83030"],
|
||||
plotOptions: {
|
||||
bar: {
|
||||
horizontal: true,
|
||||
columnWidth: '35%',
|
||||
endingShape: 'rounded'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
borderColor: 'rgba(255, 255, 255, 0.15)',
|
||||
strokeDashArray: 4,
|
||||
yaxis: {
|
||||
lines: {
|
||||
show: true
|
||||
}
|
||||
}
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
xaxis: {
|
||||
categories: ['South Korea', 'Canada', 'United Kingdom', 'Netherlands', 'Italy', 'France', 'Japan', 'United States', 'China', 'Germany'],
|
||||
}
|
||||
};
|
||||
var chart = new ApexCharts(document.querySelector("#chart5"), options);
|
||||
chart.render();
|
||||
|
||||
|
||||
// chart 6
|
||||
var options = {
|
||||
series: [{
|
||||
name: 'Website Blog',
|
||||
type: 'column',
|
||||
data: [440, 505, 414, 671, 227, 413, 201, 352, 752, 320, 257, 160]
|
||||
}, {
|
||||
name: 'Social Media',
|
||||
type: 'line',
|
||||
data: [23, 42, 35, 27, 43, 22, 17, 31, 22, 22, 12, 16]
|
||||
}],
|
||||
chart: {
|
||||
foreColor: '#9ba7b2',
|
||||
height: 350,
|
||||
type: 'line',
|
||||
zoom: {
|
||||
enabled: false
|
||||
},
|
||||
toolbar: {
|
||||
show: true
|
||||
},
|
||||
},
|
||||
stroke: {
|
||||
width: [0, 4]
|
||||
},
|
||||
grid: {
|
||||
borderColor: 'rgba(255, 255, 255, 0.15)',
|
||||
strokeDashArray: 4,
|
||||
yaxis: {
|
||||
lines: {
|
||||
show: true
|
||||
}
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
bar: {
|
||||
//horizontal: true,
|
||||
columnWidth: '35%',
|
||||
endingShape: 'rounded'
|
||||
}
|
||||
},
|
||||
colors: ["#0d6efd", "#212529"],
|
||||
title: {
|
||||
text: 'Traffic Sources'
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
enabledOnSeries: [1]
|
||||
},
|
||||
labels: ['01 Jan 2001', '02 Jan 2001', '03 Jan 2001', '04 Jan 2001', '05 Jan 2001', '06 Jan 2001', '07 Jan 2001', '08 Jan 2001', '09 Jan 2001', '10 Jan 2001', '11 Jan 2001', '12 Jan 2001'],
|
||||
xaxis: {
|
||||
type: 'datetime'
|
||||
},
|
||||
yaxis: [{
|
||||
title: {
|
||||
text: 'Website Blog',
|
||||
},
|
||||
}, {
|
||||
opposite: true,
|
||||
title: {
|
||||
text: 'Social Media'
|
||||
}
|
||||
}]
|
||||
};
|
||||
var chart = new ApexCharts(document.querySelector("#chart6"), options);
|
||||
chart.render();
|
||||
|
||||
|
||||
// chart 7
|
||||
var options = {
|
||||
series: [{
|
||||
name: 'TEAM A',
|
||||
type: 'column',
|
||||
data: [23, 11, 22, 27, 13, 22, 37, 21, 44, 22, 30]
|
||||
}, {
|
||||
name: 'TEAM B',
|
||||
type: 'area',
|
||||
data: [44, 55, 41, 67, 22, 43, 21, 41, 56, 27, 43]
|
||||
}, {
|
||||
name: 'TEAM C',
|
||||
type: 'line',
|
||||
data: [30, 25, 36, 30, 45, 35, 64, 52, 59, 36, 39]
|
||||
}],
|
||||
chart: {
|
||||
foreColor: '#9ba7b2',
|
||||
height: 350,
|
||||
type: 'line',
|
||||
stacked: false,
|
||||
zoom: {
|
||||
enabled: false
|
||||
},
|
||||
toolbar: {
|
||||
show: true
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
borderColor: 'rgba(255, 255, 255, 0.15)',
|
||||
strokeDashArray: 4,
|
||||
yaxis: {
|
||||
lines: {
|
||||
show: true
|
||||
}
|
||||
}
|
||||
},
|
||||
colors: ["#0d6efd", "#17a00e", "#f41127"],
|
||||
stroke: {
|
||||
width: [0, 2, 5],
|
||||
curve: 'smooth'
|
||||
},
|
||||
plotOptions: {
|
||||
bar: {
|
||||
columnWidth: '50%'
|
||||
}
|
||||
},
|
||||
fill: {
|
||||
opacity: [0.85, 0.25, 1],
|
||||
gradient: {
|
||||
inverseColors: false,
|
||||
shade: 'light',
|
||||
type: "vertical",
|
||||
opacityFrom: 0.85,
|
||||
opacityTo: 0.55,
|
||||
stops: [0, 100, 100, 100]
|
||||
}
|
||||
},
|
||||
labels: ['01/01/2003', '02/01/2003', '03/01/2003', '04/01/2003', '05/01/2003', '06/01/2003', '07/01/2003', '08/01/2003', '09/01/2003', '10/01/2003', '11/01/2003'],
|
||||
markers: {
|
||||
size: 0
|
||||
},
|
||||
xaxis: {
|
||||
type: 'datetime'
|
||||
},
|
||||
yaxis: {
|
||||
title: {
|
||||
text: 'Points',
|
||||
},
|
||||
min: 0
|
||||
},
|
||||
tooltip: {
|
||||
shared: true,
|
||||
intersect: false,
|
||||
y: {
|
||||
formatter: function (y) {
|
||||
if (typeof y !== "undefined") {
|
||||
return y.toFixed(0) + " points";
|
||||
}
|
||||
return y;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var chart = new ApexCharts(document.querySelector("#chart7"), options);
|
||||
chart.render();
|
||||
|
||||
|
||||
// chart 8
|
||||
var options = {
|
||||
series: [44, 55, 13, 43, 22],
|
||||
chart: {
|
||||
foreColor: '#9ba7b2',
|
||||
height: 330,
|
||||
type: 'pie',
|
||||
},
|
||||
colors: ["#0d6efd", "#6f42c1", "#d63384", "#fd7e14", "#20c997"],
|
||||
labels: ['Team A', 'Team B', 'Team C', 'Team D', 'Team E'],
|
||||
responsive: [{
|
||||
breakpoint: 480,
|
||||
options: {
|
||||
chart: {
|
||||
height: 360
|
||||
},
|
||||
legend: {
|
||||
position: 'bottom'
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
var chart = new ApexCharts(document.querySelector("#chart8"), options);
|
||||
chart.render();
|
||||
|
||||
|
||||
// chart 9
|
||||
var options = {
|
||||
series: [44, 55, 41, 17, 15],
|
||||
chart: {
|
||||
foreColor: '#9ba7b2',
|
||||
height: 380,
|
||||
type: 'donut',
|
||||
},
|
||||
colors: ["#0d6efd", "#6f42c1", "#d63384", "#fd7e14", "#20c997"],
|
||||
responsive: [{
|
||||
breakpoint: 480,
|
||||
options: {
|
||||
chart: {
|
||||
height: 320
|
||||
},
|
||||
legend: {
|
||||
position: 'bottom'
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
var chart = new ApexCharts(document.querySelector("#chart9"), options);
|
||||
chart.render();
|
||||
|
||||
|
||||
// chart 10
|
||||
var options = {
|
||||
series: [{
|
||||
name: 'Series 1',
|
||||
data: [80, 50, 30, 40, 100, 20],
|
||||
}, {
|
||||
name: 'Series 2',
|
||||
data: [20, 30, 40, 80, 20, 80],
|
||||
}, {
|
||||
name: 'Series 3',
|
||||
data: [44, 76, 78, 13, 43, 10],
|
||||
}],
|
||||
chart: {
|
||||
foreColor: '#9ba7b2',
|
||||
height: 350,
|
||||
type: 'radar',
|
||||
dropShadow: {
|
||||
enabled: true,
|
||||
blur: 1,
|
||||
left: 1,
|
||||
top: 1
|
||||
}
|
||||
},
|
||||
colors: ["#0d6efd", "#6f42c1", "#d63384"],
|
||||
title: {
|
||||
text: 'Radar Chart - Multi Series'
|
||||
},
|
||||
stroke: {
|
||||
width: 2
|
||||
},
|
||||
fill: {
|
||||
opacity: 0.1
|
||||
},
|
||||
markers: {
|
||||
size: 0
|
||||
},
|
||||
xaxis: {
|
||||
categories: ['2011', '2012', '2013', '2014', '2015', '2016']
|
||||
}
|
||||
};
|
||||
var chart = new ApexCharts(document.querySelector("#chart10"), options);
|
||||
chart.render();
|
||||
|
||||
|
||||
// chart 11
|
||||
var options = {
|
||||
series: [{
|
||||
name: 'Series 1',
|
||||
data: [20, 100, 40, 30, 50, 80, 33],
|
||||
}],
|
||||
chart: {
|
||||
foreColor: '#9ba7b2',
|
||||
height: 350,
|
||||
type: 'radar',
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: true
|
||||
},
|
||||
plotOptions: {
|
||||
radar: {
|
||||
size: 140,
|
||||
polygons: {
|
||||
strokeColors: '#e9e9e9',
|
||||
fill: {
|
||||
colors: ['#f8f8f8', '#fff']
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
title: {
|
||||
text: 'Radar with Polygon Fill'
|
||||
},
|
||||
colors: ["#0d6efd"],
|
||||
markers: {
|
||||
size: 4,
|
||||
colors: ['#fff'],
|
||||
strokeColor: '#FF4560',
|
||||
strokeWidth: 2,
|
||||
},
|
||||
tooltip: {
|
||||
y: {
|
||||
formatter: function (val) {
|
||||
return val
|
||||
}
|
||||
}
|
||||
},
|
||||
xaxis: {
|
||||
categories: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
|
||||
},
|
||||
yaxis: {
|
||||
tickAmount: 7,
|
||||
labels: {
|
||||
formatter: function (val, i) {
|
||||
if (i % 2 === 0) {
|
||||
return val
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var chart = new ApexCharts(document.querySelector("#chart11"), options);
|
||||
chart.render();
|
||||
|
||||
|
||||
|
||||
// chart 12
|
||||
|
||||
var options = {
|
||||
series: [70],
|
||||
chart: {
|
||||
foreColor: '#9ba7b2',
|
||||
height: 350,
|
||||
type: 'radialBar',
|
||||
},
|
||||
plotOptions: {
|
||||
radialBar: {
|
||||
hollow: {
|
||||
size: '70%',
|
||||
}
|
||||
},
|
||||
},
|
||||
labels: ['Cricket'],
|
||||
};
|
||||
|
||||
var chart = new ApexCharts(document.querySelector("#chart12"), options);
|
||||
chart.render();
|
||||
|
||||
|
||||
|
||||
// chart 13
|
||||
|
||||
var options = {
|
||||
series: [44, 55, 67, 83],
|
||||
chart: {
|
||||
foreColor: '#9ba7b2',
|
||||
height: 350,
|
||||
type: 'radialBar',
|
||||
},
|
||||
plotOptions: {
|
||||
radialBar: {
|
||||
dataLabels: {
|
||||
name: {
|
||||
fontSize: '22px',
|
||||
},
|
||||
value: {
|
||||
fontSize: '16px',
|
||||
},
|
||||
total: {
|
||||
show: true,
|
||||
label: 'Total',
|
||||
formatter: function (w) {
|
||||
// By default this function returns the average of all series. The below is just an example to show the use of custom formatter function
|
||||
return 249
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
colors: ["#0d6efd", "#6f42c1", "#d63384", "#fd7e14"],
|
||||
labels: ['Apples', 'Oranges', 'Bananas', 'Berries'],
|
||||
};
|
||||
|
||||
var chart = new ApexCharts(document.querySelector("#chart13"), options);
|
||||
chart.render();
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
|
@ -0,0 +1,875 @@
|
|||
.apexcharts-canvas {
|
||||
position: relative;
|
||||
user-select: none
|
||||
}
|
||||
|
||||
.apexcharts-canvas ::-webkit-scrollbar {
|
||||
-webkit-appearance: none;
|
||||
width: 6px
|
||||
}
|
||||
|
||||
.apexcharts-canvas ::-webkit-scrollbar-thumb {
|
||||
border-radius: 4px;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
|
||||
-webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5)
|
||||
}
|
||||
|
||||
.apexcharts-inner {
|
||||
position: relative
|
||||
}
|
||||
|
||||
.apexcharts-text tspan {
|
||||
font-family: inherit
|
||||
}
|
||||
|
||||
.legend-mouseover-inactive {
|
||||
transition: .15s ease all;
|
||||
opacity: .2
|
||||
}
|
||||
|
||||
.apexcharts-series-collapsed {
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
.apexcharts-tooltip {
|
||||
border-radius: 5px;
|
||||
box-shadow: 2px 2px 6px -4px #999;
|
||||
cursor: default;
|
||||
font-size: 14px;
|
||||
left: 62px;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
z-index: 12;
|
||||
transition: .15s ease all
|
||||
}
|
||||
|
||||
.apexcharts-tooltip.apexcharts-active {
|
||||
opacity: 1;
|
||||
transition: .15s ease all
|
||||
}
|
||||
|
||||
.apexcharts-tooltip.apexcharts-theme-light {
|
||||
border: 1px solid #e3e3e3;
|
||||
background: rgba(255, 255, 255, 0.96)
|
||||
}
|
||||
|
||||
.apexcharts-tooltip.apexcharts-theme-dark {
|
||||
color: #fff;
|
||||
background: rgba(30, 30, 30, 0.8)
|
||||
}
|
||||
|
||||
.apexcharts-tooltip * {
|
||||
font-family: inherit
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-title {
|
||||
padding: 6px;
|
||||
font-size: 15px;
|
||||
margin-bottom: 4px
|
||||
}
|
||||
|
||||
.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title {
|
||||
background: #eceff1;
|
||||
border-bottom: 1px solid #ddd
|
||||
}
|
||||
|
||||
.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title {
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
border-bottom: 1px solid #333
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-text-y-value,
|
||||
.apexcharts-tooltip-text-goals-value,
|
||||
.apexcharts-tooltip-text-z-value {
|
||||
display: inline-block;
|
||||
font-weight: 600;
|
||||
margin-left: 5px
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-text-y-label:empty,
|
||||
.apexcharts-tooltip-text-y-value:empty,
|
||||
.apexcharts-tooltip-text-goals-label:empty,
|
||||
.apexcharts-tooltip-text-goals-value:empty,
|
||||
.apexcharts-tooltip-text-z-value:empty {
|
||||
display: none
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-text-y-value,
|
||||
.apexcharts-tooltip-text-goals-value,
|
||||
.apexcharts-tooltip-text-z-value {
|
||||
font-weight: 600
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-text-goals-label,
|
||||
.apexcharts-tooltip-text-goals-value {
|
||||
padding: 6px 0 5px
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-goals-group,
|
||||
.apexcharts-tooltip-text-goals-label,
|
||||
.apexcharts-tooltip-text-goals-value {
|
||||
display: flex
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-text-goals-label:not(:empty),
|
||||
.apexcharts-tooltip-text-goals-value:not(:empty) {
|
||||
margin-top: -6px
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-marker {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
position: relative;
|
||||
top: 0px;
|
||||
margin-right: 10px;
|
||||
border-radius: 50%
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-series-group {
|
||||
padding: 0 10px;
|
||||
display: none;
|
||||
text-align: left;
|
||||
justify-content: left;
|
||||
align-items: center
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-marker {
|
||||
opacity: 1
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-series-group.apexcharts-active,
|
||||
.apexcharts-tooltip-series-group:last-child {
|
||||
padding-bottom: 4px
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-series-group-hidden {
|
||||
opacity: 0;
|
||||
height: 0;
|
||||
line-height: 0;
|
||||
padding: 0 !important
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-y-group {
|
||||
padding: 6px 0 5px
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-box,
|
||||
.apexcharts-custom-tooltip {
|
||||
padding: 4px 8px
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-boxPlot {
|
||||
display: flex;
|
||||
flex-direction: column-reverse
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-box>div {
|
||||
margin: 4px 0
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-box span.value {
|
||||
font-weight: bold
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-rangebar {
|
||||
padding: 5px 8px
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-rangebar .category {
|
||||
font-weight: 600;
|
||||
color: #777
|
||||
}
|
||||
|
||||
.apexcharts-tooltip-rangebar .series-name {
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
margin-bottom: 5px
|
||||
}
|
||||
|
||||
.apexcharts-xaxistooltip {
|
||||
opacity: 0;
|
||||
padding: 9px 10px;
|
||||
pointer-events: none;
|
||||
color: #373d3f;
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
border-radius: 2px;
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
background: #eceff1;
|
||||
border: 1px solid #90a4ae;
|
||||
transition: .15s ease all
|
||||
}
|
||||
|
||||
.apexcharts-xaxistooltip.apexcharts-theme-dark {
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
border: 1px solid rgba(0, 0, 0, 0.5);
|
||||
color: #fff
|
||||
}
|
||||
|
||||
.apexcharts-xaxistooltip:after,
|
||||
.apexcharts-xaxistooltip:before {
|
||||
left: 50%;
|
||||
border: solid transparent;
|
||||
content: " ";
|
||||
height: 0;
|
||||
width: 0;
|
||||
position: absolute;
|
||||
pointer-events: none
|
||||
}
|
||||
|
||||
.apexcharts-xaxistooltip:after {
|
||||
border-color: rgba(236, 239, 241, 0);
|
||||
border-width: 6px;
|
||||
margin-left: -6px
|
||||
}
|
||||
|
||||
.apexcharts-xaxistooltip:before {
|
||||
border-color: rgba(144, 164, 174, 0);
|
||||
border-width: 7px;
|
||||
margin-left: -7px
|
||||
}
|
||||
|
||||
.apexcharts-xaxistooltip-bottom:after,
|
||||
.apexcharts-xaxistooltip-bottom:before {
|
||||
bottom: 100%
|
||||
}
|
||||
|
||||
.apexcharts-xaxistooltip-top:after,
|
||||
.apexcharts-xaxistooltip-top:before {
|
||||
top: 100%
|
||||
}
|
||||
|
||||
.apexcharts-xaxistooltip-bottom:after {
|
||||
border-bottom-color: #eceff1
|
||||
}
|
||||
|
||||
.apexcharts-xaxistooltip-bottom:before {
|
||||
border-bottom-color: #90a4ae
|
||||
}
|
||||
|
||||
.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:after {
|
||||
border-bottom-color: rgba(0, 0, 0, 0.5)
|
||||
}
|
||||
|
||||
.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:before {
|
||||
border-bottom-color: rgba(0, 0, 0, 0.5)
|
||||
}
|
||||
|
||||
.apexcharts-xaxistooltip-top:after {
|
||||
border-top-color: #eceff1
|
||||
}
|
||||
|
||||
.apexcharts-xaxistooltip-top:before {
|
||||
border-top-color: #90a4ae
|
||||
}
|
||||
|
||||
.apexcharts-xaxistooltip-top.apexcharts-theme-dark:after {
|
||||
border-top-color: rgba(0, 0, 0, 0.5)
|
||||
}
|
||||
|
||||
.apexcharts-xaxistooltip-top.apexcharts-theme-dark:before {
|
||||
border-top-color: rgba(0, 0, 0, 0.5)
|
||||
}
|
||||
|
||||
.apexcharts-xaxistooltip.apexcharts-active {
|
||||
opacity: 1;
|
||||
transition: .15s ease all
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip {
|
||||
opacity: 0;
|
||||
padding: 4px 10px;
|
||||
pointer-events: none;
|
||||
color: #373d3f;
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
border-radius: 2px;
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
background: #eceff1;
|
||||
border: 1px solid #90a4ae
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip.apexcharts-theme-dark {
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
border: 1px solid rgba(0, 0, 0, 0.5);
|
||||
color: #fff
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip:after,
|
||||
.apexcharts-yaxistooltip:before {
|
||||
top: 50%;
|
||||
border: solid transparent;
|
||||
content: " ";
|
||||
height: 0;
|
||||
width: 0;
|
||||
position: absolute;
|
||||
pointer-events: none
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip:after {
|
||||
border-color: rgba(236, 239, 241, 0);
|
||||
border-width: 6px;
|
||||
margin-top: -6px
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip:before {
|
||||
border-color: rgba(144, 164, 174, 0);
|
||||
border-width: 7px;
|
||||
margin-top: -7px
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip-left:after,
|
||||
.apexcharts-yaxistooltip-left:before {
|
||||
left: 100%
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip-right:after,
|
||||
.apexcharts-yaxistooltip-right:before {
|
||||
right: 100%
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip-left:after {
|
||||
border-left-color: #eceff1
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip-left:before {
|
||||
border-left-color: #90a4ae
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip-left.apexcharts-theme-dark:after {
|
||||
border-left-color: rgba(0, 0, 0, 0.5)
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip-left.apexcharts-theme-dark:before {
|
||||
border-left-color: rgba(0, 0, 0, 0.5)
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip-right:after {
|
||||
border-right-color: #eceff1
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip-right:before {
|
||||
border-right-color: #90a4ae
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip-right.apexcharts-theme-dark:after {
|
||||
border-right-color: rgba(0, 0, 0, 0.5)
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip-right.apexcharts-theme-dark:before {
|
||||
border-right-color: rgba(0, 0, 0, 0.5)
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip.apexcharts-active {
|
||||
opacity: 1
|
||||
}
|
||||
|
||||
.apexcharts-yaxistooltip-hidden {
|
||||
display: none
|
||||
}
|
||||
|
||||
.apexcharts-xcrosshairs,
|
||||
.apexcharts-ycrosshairs {
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
transition: .15s ease all
|
||||
}
|
||||
|
||||
.apexcharts-xcrosshairs.apexcharts-active,
|
||||
.apexcharts-ycrosshairs.apexcharts-active {
|
||||
opacity: 1;
|
||||
transition: .15s ease all
|
||||
}
|
||||
|
||||
.apexcharts-ycrosshairs-hidden {
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
.apexcharts-selection-rect {
|
||||
cursor: move
|
||||
}
|
||||
|
||||
.svg_select_boundingRect,
|
||||
.svg_select_points_rot {
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
visibility: hidden
|
||||
}
|
||||
|
||||
.apexcharts-selection-rect+g .svg_select_boundingRect,
|
||||
.apexcharts-selection-rect+g .svg_select_points_rot {
|
||||
opacity: 0;
|
||||
visibility: hidden
|
||||
}
|
||||
|
||||
.apexcharts-selection-rect+g .svg_select_points_l,
|
||||
.apexcharts-selection-rect+g .svg_select_points_r {
|
||||
cursor: ew-resize;
|
||||
opacity: 1;
|
||||
visibility: visible
|
||||
}
|
||||
|
||||
.svg_select_points {
|
||||
fill: #efefef;
|
||||
stroke: #333;
|
||||
rx: 2
|
||||
}
|
||||
|
||||
.apexcharts-svg.apexcharts-zoomable.hovering-zoom {
|
||||
cursor: crosshair
|
||||
}
|
||||
|
||||
.apexcharts-svg.apexcharts-zoomable.hovering-pan {
|
||||
cursor: move
|
||||
}
|
||||
|
||||
.apexcharts-zoom-icon,
|
||||
.apexcharts-zoomin-icon,
|
||||
.apexcharts-zoomout-icon,
|
||||
.apexcharts-reset-icon,
|
||||
.apexcharts-pan-icon,
|
||||
.apexcharts-selection-icon,
|
||||
.apexcharts-menu-icon,
|
||||
.apexcharts-toolbar-custom-icon {
|
||||
cursor: pointer;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 24px;
|
||||
color: #6e8192;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.apexcharts-zoom-icon svg,
|
||||
.apexcharts-zoomin-icon svg,
|
||||
.apexcharts-zoomout-icon svg,
|
||||
.apexcharts-reset-icon svg,
|
||||
.apexcharts-menu-icon svg {
|
||||
fill: #6e8192
|
||||
}
|
||||
|
||||
.apexcharts-selection-icon svg {
|
||||
fill: #444;
|
||||
transform: scale(0.76)
|
||||
}
|
||||
|
||||
.apexcharts-theme-dark .apexcharts-zoom-icon svg,
|
||||
.apexcharts-theme-dark .apexcharts-zoomin-icon svg,
|
||||
.apexcharts-theme-dark .apexcharts-zoomout-icon svg,
|
||||
.apexcharts-theme-dark .apexcharts-reset-icon svg,
|
||||
.apexcharts-theme-dark .apexcharts-pan-icon svg,
|
||||
.apexcharts-theme-dark .apexcharts-selection-icon svg,
|
||||
.apexcharts-theme-dark .apexcharts-menu-icon svg,
|
||||
.apexcharts-theme-dark .apexcharts-toolbar-custom-icon svg {
|
||||
fill: #f3f4f5
|
||||
}
|
||||
|
||||
.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected svg,
|
||||
.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected svg,
|
||||
.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected svg {
|
||||
fill: #008ffb
|
||||
}
|
||||
|
||||
.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover svg,
|
||||
.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover svg,
|
||||
.apexcharts-theme-light .apexcharts-zoomin-icon:hover svg,
|
||||
.apexcharts-theme-light .apexcharts-zoomout-icon:hover svg,
|
||||
.apexcharts-theme-light .apexcharts-reset-icon:hover svg,
|
||||
.apexcharts-theme-light .apexcharts-menu-icon:hover svg {
|
||||
fill: #333
|
||||
}
|
||||
|
||||
.apexcharts-selection-icon,
|
||||
.apexcharts-menu-icon {
|
||||
position: relative
|
||||
}
|
||||
|
||||
.apexcharts-reset-icon {
|
||||
margin-left: 5px
|
||||
}
|
||||
|
||||
.apexcharts-zoom-icon,
|
||||
.apexcharts-reset-icon,
|
||||
.apexcharts-menu-icon {
|
||||
transform: scale(0.85)
|
||||
}
|
||||
|
||||
.apexcharts-zoomin-icon,
|
||||
.apexcharts-zoomout-icon {
|
||||
transform: scale(0.7)
|
||||
}
|
||||
|
||||
.apexcharts-zoomout-icon {
|
||||
margin-right: 3px
|
||||
}
|
||||
|
||||
.apexcharts-pan-icon {
|
||||
transform: scale(0.62);
|
||||
position: relative;
|
||||
left: 1px;
|
||||
top: 0px
|
||||
}
|
||||
|
||||
.apexcharts-pan-icon svg {
|
||||
fill: #fff;
|
||||
stroke: #6e8192;
|
||||
stroke-width: 2
|
||||
}
|
||||
|
||||
.apexcharts-pan-icon.apexcharts-selected svg {
|
||||
stroke: #008ffb
|
||||
}
|
||||
|
||||
.apexcharts-pan-icon:not(.apexcharts-selected):hover svg {
|
||||
stroke: #333
|
||||
}
|
||||
|
||||
.apexcharts-toolbar {
|
||||
position: absolute;
|
||||
z-index: 11;
|
||||
max-width: 176px;
|
||||
text-align: right;
|
||||
border-radius: 3px;
|
||||
padding: 0px 6px 2px 6px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center
|
||||
}
|
||||
|
||||
.apexcharts-menu {
|
||||
background: #fff;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 3px;
|
||||
padding: 3px;
|
||||
right: 10px;
|
||||
opacity: 0;
|
||||
min-width: 110px;
|
||||
transition: .15s ease all;
|
||||
pointer-events: none
|
||||
}
|
||||
|
||||
.apexcharts-menu.apexcharts-menu-open {
|
||||
opacity: 1;
|
||||
pointer-events: all;
|
||||
transition: .15s ease all
|
||||
}
|
||||
|
||||
.apexcharts-menu-item {
|
||||
padding: 6px 7px;
|
||||
font-size: 12px;
|
||||
cursor: pointer
|
||||
}
|
||||
|
||||
.apexcharts-theme-light .apexcharts-menu-item:hover {
|
||||
background: #eee
|
||||
}
|
||||
|
||||
.apexcharts-theme-dark .apexcharts-menu {
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
color: #fff
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
.apexcharts-canvas:hover .apexcharts-toolbar {
|
||||
opacity: 1
|
||||
}
|
||||
}
|
||||
|
||||
.apexcharts-datalabel.apexcharts-element-hidden {
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
.apexcharts-pie-label,
|
||||
.apexcharts-datalabels,
|
||||
.apexcharts-datalabel,
|
||||
.apexcharts-datalabel-label,
|
||||
.apexcharts-datalabel-value {
|
||||
cursor: default;
|
||||
pointer-events: none
|
||||
}
|
||||
|
||||
.apexcharts-pie-label-delay {
|
||||
opacity: 0;
|
||||
animation-name: opaque;
|
||||
animation-duration: .3s;
|
||||
animation-fill-mode: forwards;
|
||||
animation-timing-function: ease
|
||||
}
|
||||
|
||||
.apexcharts-canvas .apexcharts-element-hidden {
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
.apexcharts-hide .apexcharts-series-points {
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
.apexcharts-gridline,
|
||||
.apexcharts-annotation-rect,
|
||||
.apexcharts-tooltip .apexcharts-marker,
|
||||
.apexcharts-area-series .apexcharts-area,
|
||||
.apexcharts-line,
|
||||
.apexcharts-zoom-rect,
|
||||
.apexcharts-toolbar svg,
|
||||
.apexcharts-area-series .apexcharts-series-markers .apexcharts-marker.no-pointer-events,
|
||||
.apexcharts-line-series .apexcharts-series-markers .apexcharts-marker.no-pointer-events,
|
||||
.apexcharts-radar-series path,
|
||||
.apexcharts-radar-series polygon {
|
||||
pointer-events: none
|
||||
}
|
||||
|
||||
.apexcharts-marker {
|
||||
transition: .15s ease all
|
||||
}
|
||||
|
||||
@keyframes opaque {
|
||||
0% {
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes resizeanim {
|
||||
from {
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 0
|
||||
}
|
||||
}
|
||||
|
||||
.resize-triggers {
|
||||
animation: 1ms resizeanim;
|
||||
visibility: hidden;
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
.resize-triggers,
|
||||
.resize-triggers>div,
|
||||
.contract-trigger:before {
|
||||
content: " ";
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden
|
||||
}
|
||||
|
||||
.resize-triggers>div {
|
||||
background: #eee;
|
||||
overflow: auto
|
||||
}
|
||||
|
||||
.contract-trigger:before {
|
||||
width: 200%;
|
||||
height: 200%
|
||||
}
|
||||
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-tooltip {
|
||||
background: #fff;
|
||||
border-color: #d4d8dd;
|
||||
box-shadow: 0 .25rem 1rem rgba(147, 158, 170, .45)
|
||||
}
|
||||
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-title {
|
||||
background: #fff;
|
||||
border-color: #d4d8dd;
|
||||
font-family: var(--bs-font-sans-serif) !important
|
||||
}
|
||||
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-tooltip.apexcharts-theme-light {
|
||||
color: #516377
|
||||
}
|
||||
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-tooltip.apexcharts-theme-dark {
|
||||
color: #fff
|
||||
}
|
||||
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-title {
|
||||
font-weight: 500
|
||||
}
|
||||
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip {
|
||||
background: #f2f2f6;
|
||||
border-color: #d4d8dd;
|
||||
color: #516377
|
||||
}
|
||||
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-xaxistooltip-bottom:after,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-yaxistooltip-bottom:after,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-xaxistooltip-bottom:after,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-yaxistooltip-bottom:after {
|
||||
border-bottom-color: #f2f2f6
|
||||
}
|
||||
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-xaxistooltip-bottom:before,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-yaxistooltip-bottom:before,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-xaxistooltip-bottom:before,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-yaxistooltip-bottom:before {
|
||||
border-bottom-color: #d4d8dd
|
||||
}
|
||||
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-xaxistooltip-left:after,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-yaxistooltip-left:after,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-xaxistooltip-left:after,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-yaxistooltip-left:after {
|
||||
border-left-color: #f2f2f6
|
||||
}
|
||||
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-xaxistooltip-left:before,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-yaxistooltip-left:before,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-xaxistooltip-left:before,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-yaxistooltip-left:before {
|
||||
border-left-color: #d4d8dd
|
||||
}
|
||||
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-xaxistooltip-right:after,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-yaxistooltip-right:after,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-xaxistooltip-right:after,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-yaxistooltip-right:after {
|
||||
border-right-color: #f2f2f6
|
||||
}
|
||||
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-xaxistooltip-right:before,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-yaxistooltip-right:before,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-xaxistooltip-right:before,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-yaxistooltip-right:before {
|
||||
border-right-color: #d4d8dd
|
||||
}
|
||||
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-xaxistooltip-top:after,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-yaxistooltip-top:after,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-xaxistooltip-top:after,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-yaxistooltip-top:after {
|
||||
border-top-color: #f2f2f6
|
||||
}
|
||||
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-xaxistooltip-top:before,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-yaxistooltip-top:before,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-xaxistooltip-top:before,
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-yaxistooltip-top:before {
|
||||
border-top-color: #d4d8dd
|
||||
}
|
||||
|
||||
[data-bs-theme=light] .apexcharts-canvas .apexcharts-tooltip-text {
|
||||
font-family: var(--bs-font-sans-serif) !important;
|
||||
filter: none
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] #radarChart .apexcharts-canvas .apexcharts-grid line {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-tooltip {
|
||||
background: #1c222f;
|
||||
border-color: #36445d;
|
||||
box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .25)
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-title {
|
||||
background: #1c222f;
|
||||
border-color: #36445d;
|
||||
font-family: var(--bs-font-sans-serif) !important
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-tooltip.apexcharts-theme-light {
|
||||
color: #d8deea
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-tooltip.apexcharts-theme-dark {
|
||||
color: #fff
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-title {
|
||||
font-weight: 500
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip {
|
||||
background: #1c222f;
|
||||
color: #d8deea;
|
||||
border-color: #36445d
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-xaxistooltip-bottom:after,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-yaxistooltip-bottom:after,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-xaxistooltip-bottom:after,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-yaxistooltip-bottom:after {
|
||||
border-bottom-color: #1c222f
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-xaxistooltip-bottom:before,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-yaxistooltip-bottom:before,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-xaxistooltip-bottom:before,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-yaxistooltip-bottom:before {
|
||||
border-bottom-color: #36445d
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-xaxistooltip-left:after,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-yaxistooltip-left:after,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-xaxistooltip-left:after,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-yaxistooltip-left:after {
|
||||
border-left-color: #1c222f
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-xaxistooltip-left:before,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-yaxistooltip-left:before,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-xaxistooltip-left:before,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-yaxistooltip-left:before {
|
||||
border-left-color: #36445d
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-xaxistooltip-right:after,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-yaxistooltip-right:after,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-xaxistooltip-right:after,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-yaxistooltip-right:after {
|
||||
border-right-color: #1c222f
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-xaxistooltip-right:before,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-yaxistooltip-right:before,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-xaxistooltip-right:before,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-yaxistooltip-right:before {
|
||||
border-right-color: #36445d
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-xaxistooltip-top:after,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-yaxistooltip-top:after,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-xaxistooltip-top:after,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-yaxistooltip-top:after {
|
||||
border-top-color: #1c222f
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-xaxistooltip-top:before,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-xaxistooltip.apexcharts-yaxistooltip-top:before,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-xaxistooltip-top:before,
|
||||
[data-bs-theme=dark] .apexcharts-canvas .apexcharts-yaxistooltip.apexcharts-yaxistooltip-top:before {
|
||||
border-top-color: #36445d
|
||||
}
|
||||
|
||||
[dir=rtl] .apexcharts-canvas .apexcharts-yaxis text {
|
||||
text-anchor: start
|
||||
}
|
||||
|
||||
[dir=rtl] .apexcharts-canvas .apexcharts-legend-marker,
|
||||
[dir=rtl] .apexcharts-canvas .apexcharts-tooltip-marker {
|
||||
margin-right: 0;
|
||||
margin-left: .5rem
|
||||
}
|
|
@ -0,0 +1,587 @@
|
|||
/**
|
||||
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.17.1.
|
||||
* Original file: /npm/jquery-confirm@3.3.4/dist/jquery-confirm.min.js
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
import t from "../../jquery/jquery.esm.js";
|
||||
|
||||
var n, i, o = {exports: {}};
|
||||
/*!
|
||||
* jquery-confirm v3.3.4 (http://craftpip.github.io/jquery-confirm/)
|
||||
* Author: Boniface Pereira
|
||||
* Website: www.craftpip.com
|
||||
* Contact: hey@craftpip.com
|
||||
*
|
||||
* Copyright 2013-2019 jquery-confirm
|
||||
* Licensed under MIT (https://github.com/craftpip/jquery-confirm/blob/master/LICENSE)
|
||||
*/
|
||||
i = function (t) {
|
||||
var n = window;
|
||||
t.fn.confirm = function (i, o) {
|
||||
return void 0 === i && (i = {}), "string" == typeof i && (i = {
|
||||
content: i,
|
||||
title: o || !1
|
||||
}), t(this).each((function () {
|
||||
var o = t(this);
|
||||
o.attr("jc-attached") ? console.warn("jConfirm has already been attached to this element ", o[0]) : (o.on("click", (function (e) {
|
||||
e.preventDefault();
|
||||
var s = t.extend({}, i);
|
||||
if (o.attr("data-title") && (s.title = o.attr("data-title")), o.attr("data-content") && (s.content = o.attr("data-content")), void 0 === s.buttons && (s.buttons = {}), s.$target = o, o.attr("href") && 0 === Object.keys(s.buttons).length) {
|
||||
var a = t.extend(!0, {}, n.jconfirm.pluginDefaults.defaultButtons, (n.jconfirm.defaults || {}).defaultButtons || {}),
|
||||
c = Object.keys(a)[0];
|
||||
s.buttons = a, s.buttons[c].action = function () {
|
||||
location.href = o.attr("href")
|
||||
}
|
||||
}
|
||||
s.closeIcon = !1, t.confirm(s)
|
||||
})), o.attr("jc-attached", !0))
|
||||
})), t(this)
|
||||
}, t.confirm = function (i, o) {
|
||||
void 0 === i && (i = {}), "string" == typeof i && (i = {content: i, title: o || !1});
|
||||
var e = !(!1 === i.buttons);
|
||||
if ("object" != typeof i.buttons && (i.buttons = {}), 0 === Object.keys(i.buttons).length && e) {
|
||||
var s = t.extend(!0, {}, n.jconfirm.pluginDefaults.defaultButtons, (n.jconfirm.defaults || {}).defaultButtons || {});
|
||||
i.buttons = s
|
||||
}
|
||||
return n.jconfirm(i)
|
||||
}, t.alert = function (i, o) {
|
||||
void 0 === i && (i = {}), "string" == typeof i && (i = {content: i, title: o || !1});
|
||||
var e = !(!1 === i.buttons);
|
||||
if ("object" != typeof i.buttons && (i.buttons = {}), 0 === Object.keys(i.buttons).length && e) {
|
||||
var s = t.extend(!0, {}, n.jconfirm.pluginDefaults.defaultButtons, (n.jconfirm.defaults || {}).defaultButtons || {}),
|
||||
a = Object.keys(s)[0];
|
||||
i.buttons[a] = s[a]
|
||||
}
|
||||
return n.jconfirm(i)
|
||||
}, t.dialog = function (t, i) {
|
||||
return void 0 === t && (t = {}), "string" == typeof t && (t = {
|
||||
content: t,
|
||||
title: i || !1,
|
||||
closeIcon: function () {
|
||||
}
|
||||
}), t.buttons = {}, void 0 === t.closeIcon && (t.closeIcon = function () {
|
||||
}), t.confirmKeys = [13], n.jconfirm(t)
|
||||
}, n.jconfirm = function (i) {
|
||||
void 0 === i && (i = {});
|
||||
var o = t.extend(!0, {}, n.jconfirm.pluginDefaults);
|
||||
n.jconfirm.defaults && (o = t.extend(!0, o, n.jconfirm.defaults)), o = t.extend(!0, {}, o, i);
|
||||
var e = new n.Jconfirm(o);
|
||||
return n.jconfirm.instances.push(e), e
|
||||
}, n.Jconfirm = function (n) {
|
||||
t.extend(this, n), this._init()
|
||||
}, n.Jconfirm.prototype = {
|
||||
_init: function () {
|
||||
var i = this;
|
||||
n.jconfirm.instances.length || (n.jconfirm.lastFocused = t("body").find(":focus")), this._id = Math.round(99999 * Math.random()), this.contentParsed = t(document.createElement("div")), this.lazyOpen || setTimeout((function () {
|
||||
i.open()
|
||||
}), 0)
|
||||
},
|
||||
_buildHTML: function () {
|
||||
var n = this;
|
||||
this._parseAnimation(this.animation, "o"), this._parseAnimation(this.closeAnimation, "c"), this._parseBgDismissAnimation(this.backgroundDismissAnimation), this._parseColumnClass(this.columnClass), this._parseTheme(this.theme), this._parseType(this.type);
|
||||
var i = t(this.template);
|
||||
i.find(".jconfirm-box").addClass(this.animationParsed).addClass(this.backgroundDismissAnimationParsed).addClass(this.typeParsed), this.typeAnimated && i.find(".jconfirm-box").addClass("jconfirm-type-animated"), this.useBootstrap ? (i.find(".jc-bs3-row").addClass(this.bootstrapClasses.row), i.find(".jc-bs3-row").addClass("justify-content-md-center justify-content-sm-center justify-content-xs-center justify-content-lg-center"), i.find(".jconfirm-box-container").addClass(this.columnClassParsed), this.containerFluid ? i.find(".jc-bs3-container").addClass(this.bootstrapClasses.containerFluid) : i.find(".jc-bs3-container").addClass(this.bootstrapClasses.container)) : i.find(".jconfirm-box").css("width", this.boxWidth), this.titleClass && i.find(".jconfirm-title-c").addClass(this.titleClass), i.addClass(this.themeParsed);
|
||||
var o = "jconfirm-box" + this._id;
|
||||
i.find(".jconfirm-box").attr("aria-labelledby", o).attr("tabindex", -1), i.find(".jconfirm-content").attr("id", o), null !== this.bgOpacity && i.find(".jconfirm-bg").css("opacity", this.bgOpacity), this.rtl && i.addClass("jconfirm-rtl"), this.$el = i.appendTo(this.container), this.$jconfirmBoxContainer = this.$el.find(".jconfirm-box-container"), this.$jconfirmBox = this.$body = this.$el.find(".jconfirm-box"), this.$jconfirmBg = this.$el.find(".jconfirm-bg"), this.$title = this.$el.find(".jconfirm-title"), this.$titleContainer = this.$el.find(".jconfirm-title-c"), this.$content = this.$el.find("div.jconfirm-content"), this.$contentPane = this.$el.find(".jconfirm-content-pane"), this.$icon = this.$el.find(".jconfirm-icon-c"), this.$closeIcon = this.$el.find(".jconfirm-closeIcon"), this.$holder = this.$el.find(".jconfirm-holder"), this.$btnc = this.$el.find(".jconfirm-buttons"), this.$scrollPane = this.$el.find(".jconfirm-scrollpane"), n.setStartingPoint(), this._contentReady = t.Deferred(), this._modalReady = t.Deferred(), this.$holder.css({
|
||||
"padding-top": this.offsetTop,
|
||||
"padding-bottom": this.offsetBottom
|
||||
}), this.setTitle(), this.setIcon(), this._setButtons(), this._parseContent(), this.initDraggable(), this.isAjax && this.showLoading(!1), t.when(this._contentReady, this._modalReady).then((function () {
|
||||
n.isAjaxLoading ? setTimeout((function () {
|
||||
n.isAjaxLoading = !1, n.setContent(), n.setTitle(), n.setIcon(), setTimeout((function () {
|
||||
n.hideLoading(!1), n._updateContentMaxHeight()
|
||||
}), 100), "function" == typeof n.onContentReady && n.onContentReady()
|
||||
}), 50) : (n._updateContentMaxHeight(), n.setTitle(), n.setIcon(), "function" == typeof n.onContentReady && n.onContentReady()), n.autoClose && n._startCountDown()
|
||||
})).then((function () {
|
||||
n._watchContent()
|
||||
})), "none" === this.animation && (this.animationSpeed = 1, this.animationBounce = 1), this.$body.css(this._getCSS(this.animationSpeed, this.animationBounce)), this.$contentPane.css(this._getCSS(this.animationSpeed, 1)), this.$jconfirmBg.css(this._getCSS(this.animationSpeed, 1)), this.$jconfirmBoxContainer.css(this._getCSS(this.animationSpeed, 1))
|
||||
},
|
||||
_typePrefix: "jconfirm-type-",
|
||||
typeParsed: "",
|
||||
_parseType: function (t) {
|
||||
this.typeParsed = this._typePrefix + t
|
||||
},
|
||||
setType: function (t) {
|
||||
var n = this.typeParsed;
|
||||
this._parseType(t), this.$jconfirmBox.removeClass(n).addClass(this.typeParsed)
|
||||
},
|
||||
themeParsed: "",
|
||||
_themePrefix: "jconfirm-",
|
||||
setTheme: function (t) {
|
||||
var n = this.theme;
|
||||
this.theme = t || this.theme, this._parseTheme(this.theme), n && this.$el.removeClass(n), this.$el.addClass(this.themeParsed), this.theme = t
|
||||
},
|
||||
_parseTheme: function (n) {
|
||||
var i = this;
|
||||
n = n.split(","), t.each(n, (function (o, e) {
|
||||
-1 === e.indexOf(i._themePrefix) && (n[o] = i._themePrefix + t.trim(e))
|
||||
})), this.themeParsed = n.join(" ").toLowerCase()
|
||||
},
|
||||
backgroundDismissAnimationParsed: "",
|
||||
_bgDismissPrefix: "jconfirm-hilight-",
|
||||
_parseBgDismissAnimation: function (n) {
|
||||
var i = n.split(","), o = this;
|
||||
t.each(i, (function (n, e) {
|
||||
-1 === e.indexOf(o._bgDismissPrefix) && (i[n] = o._bgDismissPrefix + t.trim(e))
|
||||
})), this.backgroundDismissAnimationParsed = i.join(" ").toLowerCase()
|
||||
},
|
||||
animationParsed: "",
|
||||
closeAnimationParsed: "",
|
||||
_animationPrefix: "jconfirm-animation-",
|
||||
setAnimation: function (t) {
|
||||
this.animation = t || this.animation, this._parseAnimation(this.animation, "o")
|
||||
},
|
||||
_parseAnimation: function (n, i) {
|
||||
i = i || "o";
|
||||
var o = n.split(","), e = this;
|
||||
t.each(o, (function (n, i) {
|
||||
-1 === i.indexOf(e._animationPrefix) && (o[n] = e._animationPrefix + t.trim(i))
|
||||
}));
|
||||
var s = o.join(" ").toLowerCase();
|
||||
return "o" === i ? this.animationParsed = s : this.closeAnimationParsed = s, s
|
||||
},
|
||||
setCloseAnimation: function (t) {
|
||||
this.closeAnimation = t || this.closeAnimation, this._parseAnimation(this.closeAnimation, "c")
|
||||
},
|
||||
setAnimationSpeed: function (t) {
|
||||
this.animationSpeed = t || this.animationSpeed
|
||||
},
|
||||
columnClassParsed: "",
|
||||
setColumnClass: function (t) {
|
||||
this.useBootstrap ? (this.columnClass = t || this.columnClass, this._parseColumnClass(this.columnClass), this.$jconfirmBoxContainer.addClass(this.columnClassParsed)) : console.warn("cannot set columnClass, useBootstrap is set to false")
|
||||
},
|
||||
_updateContentMaxHeight: function () {
|
||||
var n = t(window).height() - (this.$jconfirmBox.outerHeight() - this.$contentPane.outerHeight()) - (this.offsetTop + this.offsetBottom);
|
||||
this.$contentPane.css({"max-height": n + "px"})
|
||||
},
|
||||
setBoxWidth: function (t) {
|
||||
this.useBootstrap ? console.warn("cannot set boxWidth, useBootstrap is set to true") : (this.boxWidth = t, this.$jconfirmBox.css("width", t))
|
||||
},
|
||||
_parseColumnClass: function (t) {
|
||||
var n;
|
||||
switch (t = t.toLowerCase()) {
|
||||
case"xl":
|
||||
case"xlarge":
|
||||
n = "col-md-12";
|
||||
break;
|
||||
case"l":
|
||||
case"large":
|
||||
n = "col-md-8 col-md-offset-2";
|
||||
break;
|
||||
case"m":
|
||||
case"medium":
|
||||
n = "col-md-6 col-md-offset-3";
|
||||
break;
|
||||
case"s":
|
||||
case"small":
|
||||
n = "col-md-4 col-md-offset-4";
|
||||
break;
|
||||
case"xs":
|
||||
case"xsmall":
|
||||
n = "col-md-2 col-md-offset-5";
|
||||
break;
|
||||
default:
|
||||
n = t
|
||||
}
|
||||
this.columnClassParsed = n
|
||||
},
|
||||
initDraggable: function () {
|
||||
var n = this, i = this.$titleContainer;
|
||||
this.resetDrag(), this.draggable && (i.on("mousedown", (function (t) {
|
||||
i.addClass("jconfirm-hand"), n.mouseX = t.clientX, n.mouseY = t.clientY, n.isDrag = !0
|
||||
})), t(window).on("mousemove." + this._id, (function (t) {
|
||||
n.isDrag && (n.movingX = t.clientX - n.mouseX + n.initialX, n.movingY = t.clientY - n.mouseY + n.initialY, n.setDrag())
|
||||
})), t(window).on("mouseup." + this._id, (function () {
|
||||
i.removeClass("jconfirm-hand"), n.isDrag && (n.isDrag = !1, n.initialX = n.movingX, n.initialY = n.movingY)
|
||||
})))
|
||||
},
|
||||
resetDrag: function () {
|
||||
this.isDrag = !1, this.initialX = 0, this.initialY = 0, this.movingX = 0, this.movingY = 0, this.mouseX = 0, this.mouseY = 0, this.$jconfirmBoxContainer.css("transform", "translate(0px, 0px)")
|
||||
},
|
||||
setDrag: function () {
|
||||
if (this.draggable) {
|
||||
this.alignMiddle = !1;
|
||||
var n = this.$jconfirmBox.outerWidth(), i = this.$jconfirmBox.outerHeight(), o = t(window).width(),
|
||||
e = t(window).height(), s = this;
|
||||
if (s.movingX % 1 == 0 || s.movingY % 1 == 0) {
|
||||
if (s.dragWindowBorder) {
|
||||
var a = o / 2 - n / 2, c = e / 2 - i / 2;
|
||||
c -= s.dragWindowGap, (a -= s.dragWindowGap) + s.movingX < 0 ? s.movingX = -a : a - s.movingX < 0 && (s.movingX = a), c + s.movingY < 0 ? s.movingY = -c : c - s.movingY < 0 && (s.movingY = c)
|
||||
}
|
||||
s.$jconfirmBoxContainer.css("transform", "translate(" + s.movingX + "px, " + s.movingY + "px)")
|
||||
}
|
||||
}
|
||||
},
|
||||
_scrollTop: function () {
|
||||
if ("undefined" != typeof pageYOffset) return pageYOffset;
|
||||
var t = document.body, n = document.documentElement;
|
||||
return (n = n.clientHeight ? n : t).scrollTop
|
||||
},
|
||||
_watchContent: function () {
|
||||
var n = this;
|
||||
this._timer && clearInterval(this._timer), this._timer = setInterval((function () {
|
||||
if (n.smoothContent) {
|
||||
n.$content.outerHeight();
|
||||
var i = t(window).height();
|
||||
n.offsetTop + n.offsetBottom + n.$jconfirmBox.height() - n.$contentPane.height() + n.$content.height() < i ? n.$contentPane.addClass("no-scroll") : n.$contentPane.removeClass("no-scroll")
|
||||
}
|
||||
}), this.watchInterval)
|
||||
},
|
||||
_overflowClass: "jconfirm-overflow",
|
||||
_hilightAnimating: !1,
|
||||
highlight: function () {
|
||||
this.hiLightModal()
|
||||
},
|
||||
hiLightModal: function () {
|
||||
var t = this;
|
||||
if (!this._hilightAnimating) {
|
||||
t.$body.addClass("hilight");
|
||||
var n = parseFloat(t.$body.css("animation-duration")) || 2;
|
||||
this._hilightAnimating = !0, setTimeout((function () {
|
||||
t._hilightAnimating = !1, t.$body.removeClass("hilight")
|
||||
}), 1e3 * n)
|
||||
}
|
||||
},
|
||||
_bindEvents: function () {
|
||||
var n = this;
|
||||
this.boxClicked = !1, this.$scrollPane.click((function (t) {
|
||||
if (!n.boxClicked) {
|
||||
var i, o = !1, e = !1;
|
||||
if ("string" == typeof (i = "function" == typeof n.backgroundDismiss ? n.backgroundDismiss() : n.backgroundDismiss) && void 0 !== n.buttons[i] ? (o = i, e = !1) : e = void 0 === i || 1 == !!i, o) {
|
||||
var s = n.buttons[o].action.apply(n);
|
||||
e = void 0 === s || !!s
|
||||
}
|
||||
e ? n.close() : n.hiLightModal()
|
||||
}
|
||||
n.boxClicked = !1
|
||||
})), this.$jconfirmBox.click((function (t) {
|
||||
n.boxClicked = !0
|
||||
}));
|
||||
var i = !1;
|
||||
t(window).on("jcKeyDown." + n._id, (function (t) {
|
||||
i || (i = !0)
|
||||
})), t(window).on("keyup." + n._id, (function (t) {
|
||||
i && (n.reactOnKey(t), i = !1)
|
||||
})), t(window).on("resize." + this._id, (function () {
|
||||
n._updateContentMaxHeight(), setTimeout((function () {
|
||||
n.resetDrag()
|
||||
}), 100)
|
||||
}))
|
||||
},
|
||||
_cubic_bezier: "0.36, 0.55, 0.19",
|
||||
_getCSS: function (t, n) {
|
||||
return {
|
||||
"-webkit-transition-duration": t / 1e3 + "s",
|
||||
"transition-duration": t / 1e3 + "s",
|
||||
"-webkit-transition-timing-function": "cubic-bezier(" + this._cubic_bezier + ", " + n + ")",
|
||||
"transition-timing-function": "cubic-bezier(" + this._cubic_bezier + ", " + n + ")"
|
||||
}
|
||||
},
|
||||
_setButtons: function () {
|
||||
var n = this, i = 0;
|
||||
if ("object" != typeof this.buttons && (this.buttons = {}), t.each(this.buttons, (function (o, e) {
|
||||
i += 1, "function" == typeof e && (n.buttons[o] = e = {action: e}), n.buttons[o].text = e.text || o, n.buttons[o].btnClass = e.btnClass || "btn-default", n.buttons[o].action = e.action || function () {
|
||||
}, n.buttons[o].keys = e.keys || [], n.buttons[o].isHidden = e.isHidden || !1, n.buttons[o].isDisabled = e.isDisabled || !1, t.each(n.buttons[o].keys, (function (t, i) {
|
||||
n.buttons[o].keys[t] = i.toLowerCase()
|
||||
}));
|
||||
var s = t('<button type="button" class="btn"></button>').html(n.buttons[o].text).addClass(n.buttons[o].btnClass).prop("disabled", n.buttons[o].isDisabled).css("display", n.buttons[o].isHidden ? "none" : "").click((function (t) {
|
||||
t.preventDefault();
|
||||
var i = n.buttons[o].action.apply(n, [n.buttons[o]]);
|
||||
n.onAction.apply(n, [o, n.buttons[o]]), n._stopCountDown(), (void 0 === i || i) && n.close()
|
||||
}));
|
||||
n.buttons[o].el = s, n.buttons[o].setText = function (t) {
|
||||
s.html(t)
|
||||
}, n.buttons[o].addClass = function (t) {
|
||||
s.addClass(t)
|
||||
}, n.buttons[o].removeClass = function (t) {
|
||||
s.removeClass(t)
|
||||
}, n.buttons[o].disable = function () {
|
||||
n.buttons[o].isDisabled = !0, s.prop("disabled", !0)
|
||||
}, n.buttons[o].enable = function () {
|
||||
n.buttons[o].isDisabled = !1, s.prop("disabled", !1)
|
||||
}, n.buttons[o].show = function () {
|
||||
n.buttons[o].isHidden = !1, s.css("display", "")
|
||||
}, n.buttons[o].hide = function () {
|
||||
n.buttons[o].isHidden = !0, s.css("display", "none")
|
||||
}, n["$_" + o] = n["$$" + o] = s, n.$btnc.append(s)
|
||||
})), 0 === i && this.$btnc.hide(), null === this.closeIcon && 0 === i && (this.closeIcon = !0), this.closeIcon) {
|
||||
if (this.closeIconClass) {
|
||||
var o = '<i class="' + this.closeIconClass + '"></i>';
|
||||
this.$closeIcon.html(o)
|
||||
}
|
||||
this.$closeIcon.click((function (t) {
|
||||
t.preventDefault();
|
||||
var i, o = !1, e = !1;
|
||||
if ("string" == typeof (i = "function" == typeof n.closeIcon ? n.closeIcon() : n.closeIcon) && void 0 !== n.buttons[i] ? (o = i, e = !1) : e = void 0 === i || 1 == !!i, o) {
|
||||
var s = n.buttons[o].action.apply(n);
|
||||
e = void 0 === s || !!s
|
||||
}
|
||||
e && n.close()
|
||||
})), this.$closeIcon.show()
|
||||
} else this.$closeIcon.hide()
|
||||
},
|
||||
setTitle: function (t, n) {
|
||||
if (n = n || !1, void 0 !== t) if ("string" == typeof t) this.title = t; else if ("function" == typeof t) {
|
||||
"function" == typeof t.promise && console.error("Promise was returned from title function, this is not supported.");
|
||||
var i = t();
|
||||
this.title = "string" == typeof i && i
|
||||
} else this.title = !1;
|
||||
this.isAjaxLoading && !n || (this.$title.html(this.title || ""), this.updateTitleContainer())
|
||||
},
|
||||
setIcon: function (t, n) {
|
||||
if (n = n || !1, void 0 !== t) if ("string" == typeof t) this.icon = t; else if ("function" == typeof t) {
|
||||
var i = t();
|
||||
this.icon = "string" == typeof i && i
|
||||
} else this.icon = !1;
|
||||
this.isAjaxLoading && !n || (this.$icon.html(this.icon ? '<i class="' + this.icon + '"></i>' : ""), this.updateTitleContainer())
|
||||
},
|
||||
updateTitleContainer: function () {
|
||||
this.title || this.icon ? this.$titleContainer.show() : this.$titleContainer.hide()
|
||||
},
|
||||
setContentPrepend: function (t, n) {
|
||||
t && this.contentParsed.prepend(t)
|
||||
},
|
||||
setContentAppend: function (t) {
|
||||
t && this.contentParsed.append(t)
|
||||
},
|
||||
setContent: function (t, n) {
|
||||
n = !!n;
|
||||
var i = this;
|
||||
t && this.contentParsed.html("").append(t), this.isAjaxLoading && !n || (this.$content.html(""), this.$content.append(this.contentParsed), setTimeout((function () {
|
||||
i.$body.find("input[autofocus]:visible:first").focus()
|
||||
}), 100))
|
||||
},
|
||||
loadingSpinner: !1,
|
||||
showLoading: function (t) {
|
||||
this.loadingSpinner = !0, this.$jconfirmBox.addClass("loading"), t && this.$btnc.find("button").prop("disabled", !0)
|
||||
},
|
||||
hideLoading: function (t) {
|
||||
this.loadingSpinner = !1, this.$jconfirmBox.removeClass("loading"), t && this.$btnc.find("button").prop("disabled", !1)
|
||||
},
|
||||
ajaxResponse: !1,
|
||||
contentParsed: "",
|
||||
isAjax: !1,
|
||||
isAjaxLoading: !1,
|
||||
_parseContent: function () {
|
||||
var n = this, i = " ";
|
||||
if ("function" == typeof this.content) {
|
||||
var o = this.content.apply(this);
|
||||
"string" == typeof o ? this.content = o : "object" == typeof o && "function" == typeof o.always ? (this.isAjax = !0, this.isAjaxLoading = !0, o.always((function (t, i, o) {
|
||||
n.ajaxResponse = {
|
||||
data: t,
|
||||
status: i,
|
||||
xhr: o
|
||||
}, n._contentReady.resolve(t, i, o), "function" == typeof n.contentLoaded && n.contentLoaded(t, i, o)
|
||||
})), this.content = i) : this.content = i
|
||||
}
|
||||
if ("string" == typeof this.content && "url:" === this.content.substr(0, 4).toLowerCase()) {
|
||||
this.isAjax = !0, this.isAjaxLoading = !0;
|
||||
var e = this.content.substring(4, this.content.length);
|
||||
t.get(e).done((function (t) {
|
||||
n.contentParsed.html(t)
|
||||
})).always((function (t, i, o) {
|
||||
n.ajaxResponse = {
|
||||
data: t,
|
||||
status: i,
|
||||
xhr: o
|
||||
}, n._contentReady.resolve(t, i, o), "function" == typeof n.contentLoaded && n.contentLoaded(t, i, o)
|
||||
}))
|
||||
}
|
||||
this.content || (this.content = i), this.isAjax || (this.contentParsed.html(this.content), this.setContent(), n._contentReady.resolve())
|
||||
},
|
||||
_stopCountDown: function () {
|
||||
clearInterval(this.autoCloseInterval), this.$cd && this.$cd.remove()
|
||||
},
|
||||
_startCountDown: function () {
|
||||
var n = this, i = this.autoClose.split("|");
|
||||
if (2 !== i.length) return console.error("Invalid option for autoClose. example 'close|10000'"), !1;
|
||||
var o = i[0], e = parseInt(i[1]);
|
||||
if (void 0 === this.buttons[o]) return console.error("Invalid button key '" + o + "' for autoClose"), !1;
|
||||
var s = Math.ceil(e / 1e3);
|
||||
this.$cd = t('<span class="countdown"> (' + s + ")</span>").appendTo(this["$_" + o]), this.autoCloseInterval = setInterval((function () {
|
||||
n.$cd.html(" (" + (s -= 1) + ") "), s <= 0 && (n["$$" + o].trigger("click"), n._stopCountDown())
|
||||
}), 1e3)
|
||||
},
|
||||
_getKey: function (t) {
|
||||
switch (t) {
|
||||
case 192:
|
||||
return "tilde";
|
||||
case 13:
|
||||
return "enter";
|
||||
case 16:
|
||||
return "shift";
|
||||
case 9:
|
||||
return "tab";
|
||||
case 20:
|
||||
return "capslock";
|
||||
case 17:
|
||||
return "ctrl";
|
||||
case 91:
|
||||
return "win";
|
||||
case 18:
|
||||
return "alt";
|
||||
case 27:
|
||||
return "esc";
|
||||
case 32:
|
||||
return "space"
|
||||
}
|
||||
var n = String.fromCharCode(t);
|
||||
return !!/^[A-z0-9]+$/.test(n) && n.toLowerCase()
|
||||
},
|
||||
reactOnKey: function (n) {
|
||||
var i = this, o = t(".jconfirm");
|
||||
if (o.eq(o.length - 1)[0] !== this.$el[0]) return !1;
|
||||
var e = n.which;
|
||||
if (this.$content.find(":input").is(":focus") && /13|32/.test(e)) return !1;
|
||||
var s, a = this._getKey(e);
|
||||
"esc" === a && this.escapeKey && (!0 === this.escapeKey ? this.$scrollPane.trigger("click") : "string" != typeof this.escapeKey && "function" != typeof this.escapeKey || (s = "function" == typeof this.escapeKey ? this.escapeKey() : this.escapeKey) && (void 0 === this.buttons[s] ? console.warn("Invalid escapeKey, no buttons found with key " + s) : this["$_" + s].trigger("click"))), t.each(this.buttons, (function (t, n) {
|
||||
-1 !== n.keys.indexOf(a) && i["$_" + t].trigger("click")
|
||||
}))
|
||||
},
|
||||
setDialogCenter: function () {
|
||||
console.info("setDialogCenter is deprecated, dialogs are centered with CSS3 tables")
|
||||
},
|
||||
_unwatchContent: function () {
|
||||
clearInterval(this._timer)
|
||||
},
|
||||
close: function (i) {
|
||||
var o = this;
|
||||
return "function" == typeof this.onClose && this.onClose(i), this._unwatchContent(), t(window).unbind("resize." + this._id), t(window).unbind("keyup." + this._id), t(window).unbind("jcKeyDown." + this._id), this.draggable && (t(window).unbind("mousemove." + this._id), t(window).unbind("mouseup." + this._id), this.$titleContainer.unbind("mousedown")), o.$el.removeClass(o.loadedClass), t("body").removeClass("jconfirm-no-scroll-" + o._id), o.$jconfirmBoxContainer.removeClass("jconfirm-no-transition"), setTimeout((function () {
|
||||
o.$body.addClass(o.closeAnimationParsed), o.$jconfirmBg.addClass("jconfirm-bg-h");
|
||||
var i = "none" === o.closeAnimation ? 1 : o.animationSpeed;
|
||||
setTimeout((function () {
|
||||
o.$el.remove(), n.jconfirm.instances;
|
||||
for (var i = n.jconfirm.instances.length - 1; i >= 0; i--) n.jconfirm.instances[i]._id === o._id && n.jconfirm.instances.splice(i, 1);
|
||||
if (!n.jconfirm.instances.length && o.scrollToPreviousElement && n.jconfirm.lastFocused && n.jconfirm.lastFocused.length && t.contains(document, n.jconfirm.lastFocused[0])) {
|
||||
var e = n.jconfirm.lastFocused;
|
||||
if (o.scrollToPreviousElementAnimate) {
|
||||
var s = t(window).scrollTop(), a = n.jconfirm.lastFocused.offset().top,
|
||||
c = t(window).height();
|
||||
if (a > s && a < s + c) e.focus(); else {
|
||||
var r = a - Math.round(c / 3);
|
||||
t("html, body").animate({scrollTop: r}, o.animationSpeed, "swing", (function () {
|
||||
e.focus()
|
||||
}))
|
||||
}
|
||||
} else e.focus();
|
||||
n.jconfirm.lastFocused = !1
|
||||
}
|
||||
"function" == typeof o.onDestroy && o.onDestroy()
|
||||
}), .4 * i)
|
||||
}), 50), !0
|
||||
},
|
||||
open: function () {
|
||||
return !this.isOpen() && (this._buildHTML(), this._bindEvents(), this._open(), !0)
|
||||
},
|
||||
setStartingPoint: function () {
|
||||
var i = !1;
|
||||
if (!0 !== this.animateFromElement && this.animateFromElement) i = this.animateFromElement, n.jconfirm.lastClicked = !1; else {
|
||||
if (!n.jconfirm.lastClicked || !0 !== this.animateFromElement) return !1;
|
||||
i = n.jconfirm.lastClicked, n.jconfirm.lastClicked = !1
|
||||
}
|
||||
if (!i) return !1;
|
||||
var o = i.offset(), e = i.outerHeight() / 2, s = i.outerWidth() / 2;
|
||||
e -= this.$jconfirmBox.outerHeight() / 2, s -= this.$jconfirmBox.outerWidth() / 2;
|
||||
var a = o.top + e;
|
||||
a -= this._scrollTop();
|
||||
var c = o.left + s, r = t(window).height() / 2, l = t(window).width() / 2;
|
||||
if (a -= r - this.$jconfirmBox.outerHeight() / 2, c -= l - this.$jconfirmBox.outerWidth() / 2, Math.abs(a) > r || Math.abs(c) > l) return !1;
|
||||
this.$jconfirmBoxContainer.css("transform", "translate(" + c + "px, " + a + "px)")
|
||||
},
|
||||
_open: function () {
|
||||
var t = this;
|
||||
"function" == typeof t.onOpenBefore && t.onOpenBefore(), this.$body.removeClass(this.animationParsed), this.$jconfirmBg.removeClass("jconfirm-bg-h"), this.$body.focus(), t.$jconfirmBoxContainer.css("transform", "translate(0px, 0px)"), setTimeout((function () {
|
||||
t.$body.css(t._getCSS(t.animationSpeed, 1)), t.$body.css({"transition-property": t.$body.css("transition-property") + ", margin"}), t.$jconfirmBoxContainer.addClass("jconfirm-no-transition"), t._modalReady.resolve(), "function" == typeof t.onOpen && t.onOpen(), t.$el.addClass(t.loadedClass)
|
||||
}), this.animationSpeed)
|
||||
},
|
||||
loadedClass: "jconfirm-open",
|
||||
isClosed: function () {
|
||||
return !this.$el || 0 === this.$el.parent().length
|
||||
},
|
||||
isOpen: function () {
|
||||
return !this.isClosed()
|
||||
},
|
||||
toggle: function () {
|
||||
this.isOpen() ? this.close() : this.open()
|
||||
}
|
||||
}, n.jconfirm.instances = [], n.jconfirm.lastFocused = !1, n.jconfirm.pluginDefaults = {
|
||||
template: '<div class="jconfirm"><div class="jconfirm-bg jconfirm-bg-h"></div><div class="jconfirm-scrollpane"><div class="jconfirm-row"><div class="jconfirm-cell"><div class="jconfirm-holder"><div class="jc-bs3-container"><div class="jc-bs3-row"><div class="jconfirm-box-container jconfirm-animated"><div class="jconfirm-box" role="dialog" aria-labelledby="labelled" tabindex="-1"><div class="jconfirm-closeIcon">×</div><div class="jconfirm-title-c"><span class="jconfirm-icon-c"></span><span class="jconfirm-title"></span></div><div class="jconfirm-content-pane"><div class="jconfirm-content"></div></div><div class="jconfirm-buttons"></div><div class="jconfirm-clear"></div></div></div></div></div></div></div></div></div></div>',
|
||||
title: "Hello",
|
||||
titleClass: "",
|
||||
type: "default",
|
||||
typeAnimated: !0,
|
||||
draggable: !0,
|
||||
dragWindowGap: 15,
|
||||
dragWindowBorder: !0,
|
||||
animateFromElement: !0,
|
||||
alignMiddle: !0,
|
||||
smoothContent: !0,
|
||||
content: "Are you sure to continue?",
|
||||
buttons: {},
|
||||
defaultButtons: {
|
||||
ok: {
|
||||
action: function () {
|
||||
}
|
||||
}, close: {
|
||||
action: function () {
|
||||
}
|
||||
}
|
||||
},
|
||||
contentLoaded: function () {
|
||||
},
|
||||
icon: "",
|
||||
lazyOpen: !1,
|
||||
bgOpacity: null,
|
||||
theme: "light",
|
||||
animation: "scale",
|
||||
closeAnimation: "scale",
|
||||
animationSpeed: 400,
|
||||
animationBounce: 1,
|
||||
escapeKey: !0,
|
||||
rtl: !1,
|
||||
container: "body",
|
||||
containerFluid: !1,
|
||||
backgroundDismiss: !1,
|
||||
backgroundDismissAnimation: "shake",
|
||||
autoClose: !1,
|
||||
closeIcon: null,
|
||||
closeIconClass: !1,
|
||||
watchInterval: 100,
|
||||
columnClass: "col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1",
|
||||
boxWidth: "50%",
|
||||
scrollToPreviousElement: !0,
|
||||
scrollToPreviousElementAnimate: !0,
|
||||
useBootstrap: !0,
|
||||
offsetTop: 40,
|
||||
offsetBottom: 40,
|
||||
bootstrapClasses: {container: "container", containerFluid: "container-fluid", row: "row"},
|
||||
onContentReady: function () {
|
||||
},
|
||||
onOpenBefore: function () {
|
||||
},
|
||||
onOpen: function () {
|
||||
},
|
||||
onClose: function () {
|
||||
},
|
||||
onDestroy: function () {
|
||||
},
|
||||
onAction: function () {
|
||||
}
|
||||
};
|
||||
var i = !1;
|
||||
t(window).on("keydown", (function (n) {
|
||||
if (!i) {
|
||||
var o = !1;
|
||||
t(n.target).closest(".jconfirm-box").length && (o = !0), o && t(window).trigger("jcKeyDown"), i = !0
|
||||
}
|
||||
})), t(window).on("keyup", (function () {
|
||||
i = !1
|
||||
})), n.jconfirm.lastClicked = !1, t(document).on("mousedown", "button, a, [jc-source]", (function () {
|
||||
n.jconfirm.lastClicked = t(this)
|
||||
}))
|
||||
}, (n = o).exports ? n.exports = function (n, o) {
|
||||
return void 0 === o && (o = "undefined" != typeof window ? t : t(n)), i(o), o
|
||||
} : i(jQuery);
|
||||
var e = o.exports;
|
||||
export {e as default};
|
||||
//# sourceMappingURL=/sm/e08b7778894a1fd06c499183c7ba56a9435f032d9f53bb5ee4764ae492bc721c.map
|
|
@ -0,0 +1,364 @@
|
|||
/**!
|
||||
* easy-pie-chart
|
||||
* Lightweight plugin to render simple, animated and retina optimized pie charts
|
||||
*
|
||||
* @license
|
||||
* @author Robert Fleischmann <rendro87@gmail.com> (http://robert-fleischmann.de)
|
||||
* @version 2.1.7
|
||||
**/
|
||||
import jQuery from '../jquery/jquery.esm.js';
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||
define(["jquery"], function (a0) {
|
||||
return (factory(a0));
|
||||
});
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory(require("jquery"));
|
||||
} else {
|
||||
factory(jQuery);
|
||||
}
|
||||
}(this, function ($) {
|
||||
|
||||
/**
|
||||
* Renderer to render the chart on a canvas object
|
||||
* @param {DOMElement} el DOM element to host the canvas (root of the plugin)
|
||||
* @param {object} options options object of the plugin
|
||||
*/
|
||||
var CanvasRenderer = function(el, options) {
|
||||
var cachedBackground;
|
||||
var canvas = document.createElement('canvas');
|
||||
|
||||
el.appendChild(canvas);
|
||||
|
||||
if (typeof(G_vmlCanvasManager) === 'object') {
|
||||
G_vmlCanvasManager.initElement(canvas);
|
||||
}
|
||||
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
canvas.width = canvas.height = options.size;
|
||||
|
||||
// canvas on retina devices
|
||||
var scaleBy = 1;
|
||||
if (window.devicePixelRatio > 1) {
|
||||
scaleBy = window.devicePixelRatio;
|
||||
canvas.style.width = canvas.style.height = [options.size, 'px'].join('');
|
||||
canvas.width = canvas.height = options.size * scaleBy;
|
||||
ctx.scale(scaleBy, scaleBy);
|
||||
}
|
||||
|
||||
// move 0,0 coordinates to the center
|
||||
ctx.translate(options.size / 2, options.size / 2);
|
||||
|
||||
// rotate canvas -90deg
|
||||
ctx.rotate((-1 / 2 + options.rotate / 180) * Math.PI);
|
||||
|
||||
var radius = (options.size - options.lineWidth) / 2;
|
||||
if (options.scaleColor && options.scaleLength) {
|
||||
radius -= options.scaleLength + 2; // 2 is the distance between scale and bar
|
||||
}
|
||||
|
||||
// IE polyfill for Date
|
||||
Date.now = Date.now || function() {
|
||||
return +(new Date());
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw a circle around the center of the canvas
|
||||
* @param {strong} color Valid CSS color string
|
||||
* @param {number} lineWidth Width of the line in px
|
||||
* @param {number} percent Percentage to draw (float between -1 and 1)
|
||||
*/
|
||||
var drawCircle = function(color, lineWidth, percent) {
|
||||
percent = Math.min(Math.max(-1, percent || 0), 1);
|
||||
var isNegative = percent <= 0 ? true : false;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 0, radius, 0, Math.PI * 2 * percent, isNegative);
|
||||
|
||||
ctx.strokeStyle = color;
|
||||
ctx.lineWidth = lineWidth;
|
||||
|
||||
ctx.stroke();
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw the scale of the chart
|
||||
*/
|
||||
var drawScale = function() {
|
||||
var offset;
|
||||
var length;
|
||||
|
||||
ctx.lineWidth = 1;
|
||||
ctx.fillStyle = options.scaleColor;
|
||||
|
||||
ctx.save();
|
||||
for (var i = 24; i > 0; --i) {
|
||||
if (i % 6 === 0) {
|
||||
length = options.scaleLength;
|
||||
offset = 0;
|
||||
} else {
|
||||
length = options.scaleLength * 0.6;
|
||||
offset = options.scaleLength - length;
|
||||
}
|
||||
ctx.fillRect(-options.size/2 + offset, 0, length, 1);
|
||||
ctx.rotate(Math.PI / 12);
|
||||
}
|
||||
ctx.restore();
|
||||
};
|
||||
|
||||
/**
|
||||
* Request animation frame wrapper with polyfill
|
||||
* @return {function} Request animation frame method or timeout fallback
|
||||
*/
|
||||
var reqAnimationFrame = (function() {
|
||||
return window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
function(callback) {
|
||||
window.setTimeout(callback, 1000 / 60);
|
||||
};
|
||||
}());
|
||||
|
||||
/**
|
||||
* Draw the background of the plugin including the scale and the track
|
||||
*/
|
||||
var drawBackground = function() {
|
||||
if(options.scaleColor) drawScale();
|
||||
if(options.trackColor) drawCircle(options.trackColor, options.trackWidth || options.lineWidth, 1);
|
||||
};
|
||||
|
||||
/**
|
||||
* Canvas accessor
|
||||
*/
|
||||
this.getCanvas = function() {
|
||||
return canvas;
|
||||
};
|
||||
|
||||
/**
|
||||
* Canvas 2D context 'ctx' accessor
|
||||
*/
|
||||
this.getCtx = function() {
|
||||
return ctx;
|
||||
};
|
||||
|
||||
/**
|
||||
* Clear the complete canvas
|
||||
*/
|
||||
this.clear = function() {
|
||||
ctx.clearRect(options.size / -2, options.size / -2, options.size, options.size);
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw the complete chart
|
||||
* @param {number} percent Percent shown by the chart between -100 and 100
|
||||
*/
|
||||
this.draw = function(percent) {
|
||||
// do we need to render a background
|
||||
if (!!options.scaleColor || !!options.trackColor) {
|
||||
// getImageData and putImageData are supported
|
||||
if (ctx.getImageData && ctx.putImageData) {
|
||||
if (!cachedBackground) {
|
||||
drawBackground();
|
||||
cachedBackground = ctx.getImageData(0, 0, options.size * scaleBy, options.size * scaleBy);
|
||||
} else {
|
||||
ctx.putImageData(cachedBackground, 0, 0);
|
||||
}
|
||||
} else {
|
||||
this.clear();
|
||||
drawBackground();
|
||||
}
|
||||
} else {
|
||||
this.clear();
|
||||
}
|
||||
|
||||
ctx.lineCap = options.lineCap;
|
||||
|
||||
// if barcolor is a function execute it and pass the percent as a value
|
||||
var color;
|
||||
if (typeof(options.barColor) === 'function') {
|
||||
color = options.barColor(percent);
|
||||
} else {
|
||||
color = options.barColor;
|
||||
}
|
||||
|
||||
// draw bar
|
||||
drawCircle(color, options.lineWidth, percent / 100);
|
||||
}.bind(this);
|
||||
|
||||
/**
|
||||
* Animate from some percent to some other percentage
|
||||
* @param {number} from Starting percentage
|
||||
* @param {number} to Final percentage
|
||||
*/
|
||||
this.animate = function(from, to) {
|
||||
var startTime = Date.now();
|
||||
options.onStart(from, to);
|
||||
var animation = function() {
|
||||
var process = Math.min(Date.now() - startTime, options.animate.duration);
|
||||
var currentValue = options.easing(this, process, from, to - from, options.animate.duration);
|
||||
this.draw(currentValue);
|
||||
options.onStep(from, to, currentValue);
|
||||
if (process >= options.animate.duration) {
|
||||
options.onStop(from, to);
|
||||
} else {
|
||||
reqAnimationFrame(animation);
|
||||
}
|
||||
}.bind(this);
|
||||
|
||||
reqAnimationFrame(animation);
|
||||
}.bind(this);
|
||||
};
|
||||
|
||||
var EasyPieChart = function(el, opts) {
|
||||
var defaultOptions = {
|
||||
barColor: '#ef1e25',
|
||||
trackColor: '#f9f9f9',
|
||||
scaleColor: '#dfe0e0',
|
||||
scaleLength: 5,
|
||||
lineCap: 'round',
|
||||
lineWidth: 3,
|
||||
trackWidth: undefined,
|
||||
size: 110,
|
||||
rotate: 0,
|
||||
animate: {
|
||||
duration: 1000,
|
||||
enabled: true
|
||||
},
|
||||
easing: function (x, t, b, c, d) { // more can be found here: http://gsgd.co.uk/sandbox/jquery/easing/
|
||||
t = t / (d/2);
|
||||
if (t < 1) {
|
||||
return c / 2 * t * t + b;
|
||||
}
|
||||
return -c/2 * ((--t)*(t-2) - 1) + b;
|
||||
},
|
||||
onStart: function(from, to) {
|
||||
return;
|
||||
},
|
||||
onStep: function(from, to, currentValue) {
|
||||
return;
|
||||
},
|
||||
onStop: function(from, to) {
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
// detect present renderer
|
||||
if (typeof(CanvasRenderer) !== 'undefined') {
|
||||
defaultOptions.renderer = CanvasRenderer;
|
||||
} else if (typeof(SVGRenderer) !== 'undefined') {
|
||||
defaultOptions.renderer = SVGRenderer;
|
||||
} else {
|
||||
throw new Error('Please load either the SVG- or the CanvasRenderer');
|
||||
}
|
||||
|
||||
var options = {};
|
||||
var currentValue = 0;
|
||||
|
||||
/**
|
||||
* Initialize the plugin by creating the options object and initialize rendering
|
||||
*/
|
||||
var init = function() {
|
||||
this.el = el;
|
||||
this.options = options;
|
||||
|
||||
// merge user options into default options
|
||||
for (var i in defaultOptions) {
|
||||
if (defaultOptions.hasOwnProperty(i)) {
|
||||
options[i] = opts && typeof(opts[i]) !== 'undefined' ? opts[i] : defaultOptions[i];
|
||||
if (typeof(options[i]) === 'function') {
|
||||
options[i] = options[i].bind(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check for jQuery easing
|
||||
if (typeof(options.easing) === 'string' && typeof(jQuery) !== 'undefined' && jQuery.isFunction(jQuery.easing[options.easing])) {
|
||||
options.easing = jQuery.easing[options.easing];
|
||||
} else {
|
||||
options.easing = defaultOptions.easing;
|
||||
}
|
||||
|
||||
// process earlier animate option to avoid bc breaks
|
||||
if (typeof(options.animate) === 'number') {
|
||||
options.animate = {
|
||||
duration: options.animate,
|
||||
enabled: true
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof(options.animate) === 'boolean' && !options.animate) {
|
||||
options.animate = {
|
||||
duration: 1000,
|
||||
enabled: options.animate
|
||||
};
|
||||
}
|
||||
|
||||
// create renderer
|
||||
this.renderer = new options.renderer(el, options);
|
||||
|
||||
// initial draw
|
||||
this.renderer.draw(currentValue);
|
||||
|
||||
// initial update
|
||||
if (el.dataset && el.dataset.percent) {
|
||||
this.update(parseFloat(el.dataset.percent));
|
||||
} else if (el.getAttribute && el.getAttribute('data-percent')) {
|
||||
this.update(parseFloat(el.getAttribute('data-percent')));
|
||||
}
|
||||
}.bind(this);
|
||||
|
||||
/**
|
||||
* Update the value of the chart
|
||||
* @param {number} newValue Number between 0 and 100
|
||||
* @return {object} Instance of the plugin for method chaining
|
||||
*/
|
||||
this.update = function(newValue) {
|
||||
newValue = parseFloat(newValue);
|
||||
if (options.animate.enabled) {
|
||||
this.renderer.animate(currentValue, newValue);
|
||||
} else {
|
||||
this.renderer.draw(newValue);
|
||||
}
|
||||
currentValue = newValue;
|
||||
return this;
|
||||
}.bind(this);
|
||||
|
||||
/**
|
||||
* Disable animation
|
||||
* @return {object} Instance of the plugin for method chaining
|
||||
*/
|
||||
this.disableAnimation = function() {
|
||||
options.animate.enabled = false;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Enable animation
|
||||
* @return {object} Instance of the plugin for method chaining
|
||||
*/
|
||||
this.enableAnimation = function() {
|
||||
options.animate.enabled = true;
|
||||
return this;
|
||||
};
|
||||
|
||||
init();
|
||||
};
|
||||
|
||||
$.fn.easyPieChart = function(options) {
|
||||
return this.each(function() {
|
||||
var instanceOptions;
|
||||
|
||||
if (!$.data(this, 'easyPieChart')) {
|
||||
instanceOptions = $.extend({}, options, $(this).data());
|
||||
$.data(this, 'easyPieChart', new EasyPieChart(this, instanceOptions));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
}));
|
|
@ -0,0 +1,688 @@
|
|||
/*!
|
||||
* bootstrap-fileinput v5.5.3
|
||||
* http://plugins.krajee.com/file-input
|
||||
*
|
||||
* Krajee default styling for bootstrap-fileinput.
|
||||
*
|
||||
* Author: Kartik Visweswaran
|
||||
* Copyright: 2014 - 2022, Kartik Visweswaran, Krajee.com
|
||||
*
|
||||
* Licensed under the BSD-3-Clause
|
||||
* https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
.file-loading input[type=file],
|
||||
input[type=file].file-loading {
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.file-no-browse {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: 20%;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
font-size: 0;
|
||||
opacity: 0;
|
||||
border: none;
|
||||
background: none;
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.kv-hidden,
|
||||
.file-caption-icon,
|
||||
.file-zoom-dialog .modal-header:before,
|
||||
.file-zoom-dialog .modal-header:after,
|
||||
.file-input-new .file-preview,
|
||||
.file-input-new .close,
|
||||
.file-input-new .glyphicon-file,
|
||||
.file-input-new .fileinput-remove-button,
|
||||
.file-input-new .fileinput-upload-button,
|
||||
.file-input-new .no-browse .input-group-btn,
|
||||
.file-input-ajax-new .fileinput-remove-button,
|
||||
.file-input-ajax-new .fileinput-upload-button,
|
||||
.file-input-ajax-new .no-browse .input-group-btn,
|
||||
.hide-content .kv-file-content,
|
||||
.is-locked .fileinput-upload-button,
|
||||
.is-locked .fileinput-remove-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.file-caption .input-group {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btn-file input[type=file],
|
||||
.file-caption-icon,
|
||||
.file-preview .fileinput-remove,
|
||||
.krajee-default .file-thumb-progress,
|
||||
.file-zoom-dialog .btn-navigate,
|
||||
.file-zoom-dialog .floating-buttons {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.file-caption-icon .kv-caption-icon {
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
.file-input,
|
||||
.file-loading:before,
|
||||
.btn-file,
|
||||
.file-caption,
|
||||
.file-preview,
|
||||
.krajee-default.file-preview-frame,
|
||||
.krajee-default .file-thumbnail-footer,
|
||||
.file-zoom-dialog .modal-dialog {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.file-error-message pre,
|
||||
.file-error-message ul,
|
||||
.krajee-default .file-actions,
|
||||
.krajee-default .file-other-error {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.file-error-message pre,
|
||||
.file-error-message ul {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.krajee-default .file-drag-handle,
|
||||
.krajee-default .file-upload-indicator {
|
||||
float: left;
|
||||
margin-top: 10px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.file-thumb-progress .progress,
|
||||
.file-thumb-progress .progress-bar {
|
||||
font-family: Verdana, Helvetica, sans-serif;
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
|
||||
.krajee-default .file-thumb-progress .progress,
|
||||
.kv-upload-progress .progress {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.krajee-default .file-caption-info,
|
||||
.krajee-default .file-size-info {
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
width: 160px;
|
||||
height: 15px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.file-zoom-content > .file-object.type-video,
|
||||
.file-zoom-content > .file-object.type-flash,
|
||||
.file-zoom-content > .file-object.type-image {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.file-zoom-content > .file-object.type-video,
|
||||
.file-zoom-content > .file-object.type-flash {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.file-zoom-content > .file-object.type-pdf,
|
||||
.file-zoom-content > .file-object.type-html,
|
||||
.file-zoom-content > .file-object.type-text,
|
||||
.file-zoom-content > .file-object.type-default {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.file-loading:before {
|
||||
content: " Loading...";
|
||||
display: inline-block;
|
||||
padding-left: 20px;
|
||||
line-height: 16px;
|
||||
font-size: 13px;
|
||||
font-variant: small-caps;
|
||||
color: #999;
|
||||
background: transparent url(../img/loading.gif) top left no-repeat;
|
||||
}
|
||||
|
||||
.file-object {
|
||||
margin: 0 0 -5px 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.btn-file {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.btn-file input[type=file] {
|
||||
top: 0;
|
||||
left: 0;
|
||||
min-width: 100%;
|
||||
min-height: 100%;
|
||||
text-align: right;
|
||||
opacity: 0;
|
||||
background: none repeat scroll 0 0 transparent;
|
||||
cursor: inherit;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.btn-file ::-ms-browse {
|
||||
font-size: 10000px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.file-caption.icon-visible .file-caption-icon {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.file-caption.icon-visible .file-caption-name {
|
||||
padding-left: 25px;
|
||||
}
|
||||
|
||||
.file-caption.icon-visible > .input-group-lg .file-caption-name {
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
.file-caption.icon-visible > .input-group-sm .file-caption-name {
|
||||
padding-left: 22px;
|
||||
}
|
||||
|
||||
.file-caption-name:not(.file-caption-disabled) {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.file-caption-name.file-processing {
|
||||
font-style: italic;
|
||||
border-color: #bbb;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.file-caption-icon {
|
||||
padding: 7px 5px;
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
.input-group-lg .file-caption-icon {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.input-group-sm .file-caption-icon {
|
||||
font-size: 0.875rem;
|
||||
padding: 0.25rem;
|
||||
}
|
||||
|
||||
.file-error-message {
|
||||
color: #a94442;
|
||||
background-color: #f2dede;
|
||||
margin: 5px;
|
||||
border: 1px solid #ebccd1;
|
||||
border-radius: 4px;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.file-error-message pre {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.file-caption-disabled {
|
||||
background-color: #eee;
|
||||
cursor: not-allowed;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.file-preview {
|
||||
border-radius: 5px;
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px;
|
||||
width: 100%;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.file-preview .btn-xs {
|
||||
padding: 1px 5px;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.file-preview .fileinput-remove {
|
||||
top: 1px;
|
||||
right: 1px;
|
||||
line-height: 10px;
|
||||
}
|
||||
|
||||
.file-preview .clickable {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.file-preview-image {
|
||||
font: 40px Impact, Charcoal, sans-serif;
|
||||
color: #008000;
|
||||
width: auto;
|
||||
height: auto;
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.krajee-default.file-preview-frame {
|
||||
margin: 8px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
|
||||
padding: 6px;
|
||||
float: left;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
.krajee-default.file-preview-frame .kv-file-content {
|
||||
width: 213px;
|
||||
height: 160px;
|
||||
}
|
||||
|
||||
.krajee-default.file-preview-frame .kv-file-content.kv-pdf-rendered {
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.krajee-default.file-preview-frame[data-template="audio"] .kv-file-content {
|
||||
width: 240px;
|
||||
height: 55px;
|
||||
}
|
||||
|
||||
.krajee-default.file-preview-frame .file-thumbnail-footer {
|
||||
height: 70px;
|
||||
}
|
||||
|
||||
.krajee-default.file-preview-frame:not(.file-preview-error):hover {
|
||||
border: 1px solid rgba(0, 0, 0, 0.3);
|
||||
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.krajee-default .file-preview-text {
|
||||
color: #428bca;
|
||||
border: 1px solid #ddd;
|
||||
outline: none;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.krajee-default .file-preview-html {
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.krajee-default .file-other-icon {
|
||||
font-size: 6em;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.krajee-default .file-footer-buttons {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.krajee-default .file-footer-caption {
|
||||
display: block;
|
||||
text-align: center;
|
||||
padding-top: 4px;
|
||||
font-size: 11px;
|
||||
color: #999;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.file-upload-stats {
|
||||
font-size: 10px;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.kv-upload-progress .file-upload-stats {
|
||||
font-size: 12px;
|
||||
margin: -10px 0 5px;
|
||||
}
|
||||
|
||||
.krajee-default .file-preview-error {
|
||||
opacity: 0.65;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.krajee-default .file-thumb-progress {
|
||||
top: 37px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.krajee-default.kvsortable-ghost {
|
||||
background: #e1edf7;
|
||||
border: 2px solid #a1abff;
|
||||
}
|
||||
|
||||
.krajee-default .file-preview-other:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.krajee-default .file-preview-frame:not(.file-preview-error) .file-footer-caption:hover {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.kv-upload-progress .progress {
|
||||
height: 20px;
|
||||
margin: 10px 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.kv-upload-progress .progress-bar {
|
||||
height: 20px;
|
||||
font-family: Verdana, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
|
||||
/*noinspection CssOverwrittenProperties*/
|
||||
|
||||
.file-zoom-dialog .file-other-icon {
|
||||
font-size: 22em;
|
||||
font-size: 50vmin;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .modal-dialog {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .modal-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .btn-navigate {
|
||||
margin: 0 0.1rem;
|
||||
padding: 0;
|
||||
font-size: 1.2rem;
|
||||
width: 2.4rem;
|
||||
height: 2.4rem;
|
||||
top: 50%;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn-navigate * {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .floating-buttons {
|
||||
top: 5px;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .btn-kv-prev {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .btn-kv-next {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-zoom-header {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-zoom-body {
|
||||
padding: 0.25rem;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-zoom-description {
|
||||
position: absolute;
|
||||
opacity: 0.8;
|
||||
font-size: 0.8rem;
|
||||
background-color: #1a1a1a;
|
||||
padding: 1rem;
|
||||
text-align: center;
|
||||
border-radius: 0.5rem;
|
||||
color: #fff;
|
||||
left: 15%;
|
||||
right: 15%;
|
||||
bottom: 15%;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-desc-hide {
|
||||
float: right;
|
||||
color: #fff;
|
||||
padding: 0 0.1rem;
|
||||
background: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-desc-hide:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-desc-hide:focus {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.file-input-new .no-browse .form-control {
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.file-input-ajax-new .no-browse .form-control {
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.file-caption {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.file-thumb-loading {
|
||||
background: transparent url(../img/loading.gif) no-repeat scroll center center content-box !important;
|
||||
}
|
||||
|
||||
.file-drop-zone {
|
||||
border: 1px dashed #aaa;
|
||||
min-height: 260px;
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
margin: 12px 15px 12px 12px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.file-drop-zone.clickable:hover {
|
||||
border: 2px dashed #999;
|
||||
}
|
||||
|
||||
.file-drop-zone.clickable:focus {
|
||||
border: 2px solid #5acde2;
|
||||
}
|
||||
|
||||
.file-drop-zone .file-preview-thumbnails {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.file-drop-zone-title {
|
||||
color: #aaa;
|
||||
font-size: 1.6em;
|
||||
text-align: center;
|
||||
padding: 85px 10px;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.file-highlighted {
|
||||
border: 2px dashed #999 !important;
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.file-uploading {
|
||||
background: url(../img/loading-sm.gif) no-repeat center bottom 10px;
|
||||
opacity: 0.65;
|
||||
}
|
||||
|
||||
.file-zoom-fullscreen .modal-dialog {
|
||||
min-width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.file-zoom-fullscreen .modal-content {
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.file-zoom-fullscreen .kv-zoom-body {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.floating-buttons {
|
||||
z-index: 3000;
|
||||
}
|
||||
|
||||
.floating-buttons .btn-kv {
|
||||
margin-left: 3px;
|
||||
z-index: 3000;
|
||||
}
|
||||
|
||||
.kv-zoom-actions {
|
||||
min-width: 140px;
|
||||
}
|
||||
|
||||
.kv-zoom-actions .btn-kv {
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.file-zoom-content {
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.file-zoom-content:hover {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.file-zoom-content .file-preview-image {
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.file-zoom-content .file-preview-video {
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.file-zoom-content > .file-object.type-image {
|
||||
height: auto;
|
||||
min-height: inherit;
|
||||
}
|
||||
|
||||
.file-zoom-content > .file-object.type-audio {
|
||||
width: auto;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
@media (min-width: 576px) {
|
||||
.file-zoom-dialog .modal-dialog {
|
||||
max-width: 500px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.file-zoom-dialog .modal-lg {
|
||||
max-width: 800px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.file-preview-thumbnails {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .modal-header {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 350px) {
|
||||
.krajee-default.file-preview-frame:not([data-template="audio"]) .kv-file-content {
|
||||
width: 160px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 420px) {
|
||||
.krajee-default.file-preview-frame .kv-file-content.kv-pdf-rendered {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.file-loading[dir=rtl]:before {
|
||||
background: transparent url(../img/loading.gif) top right no-repeat;
|
||||
padding-left: 0;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.clickable .file-drop-zone-title {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.file-sortable .file-drag-handle:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.file-sortable .file-drag-handle {
|
||||
cursor: grab;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.file-grabbing,
|
||||
.file-grabbing * {
|
||||
cursor: not-allowed !important;
|
||||
}
|
||||
|
||||
.file-grabbing .file-preview-thumbnails * {
|
||||
cursor: grabbing !important;
|
||||
}
|
||||
|
||||
.file-preview-frame.sortable-chosen {
|
||||
background-color: #d9edf7;
|
||||
border-color: #17a2b8;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.file-preview .kv-zoom-cache {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.file-preview-other-frame, .file-preview-object, .kv-file-content, .kv-zoom-body {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.btn-kv-rotate,
|
||||
.kv-file-rotate {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.rotatable:not(.hide-rotate) .btn-kv-rotate,
|
||||
.rotatable:not(.hide-rotate) .kv-file-rotate {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.rotatable .file-zoom-detail,
|
||||
.rotatable .kv-file-content,
|
||||
.rotatable .kv-file-content > :first-child {
|
||||
transform-origin: center center;
|
||||
}
|
||||
|
||||
.rotate-animate {
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.kv-overflow-hidden {
|
||||
overflow: hidden;
|
||||
}
|
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 847 B |
|
@ -0,0 +1,126 @@
|
|||
/*!
|
||||
* FileInput <_LANG_> Translations
|
||||
*
|
||||
* This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or
|
||||
* any HTML markup tags in the messages must not be converted or translated.
|
||||
*
|
||||
* @see http://github.com/kartik-v/bootstrap-fileinput
|
||||
*
|
||||
* NOTE: this file must be saved in UTF-8 encoding.
|
||||
*/
|
||||
(function (factory) {
|
||||
'use strict';
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
factory(window.jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.fileinputLocales['_LANG_'] = {
|
||||
sizeUnits: ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
||||
bitRateUnits: ['B/s', 'KB/s', 'MB/s', 'GB/s', 'TB/s', 'PB/s', 'EB/s', 'ZB/s', 'YB/s'],
|
||||
fileSingle: 'file',
|
||||
filePlural: 'files',
|
||||
browseLabel: 'Browse …',
|
||||
removeLabel: 'Remove',
|
||||
removeTitle: 'Clear selected files',
|
||||
cancelLabel: 'Cancel',
|
||||
cancelTitle: 'Abort ongoing upload',
|
||||
pauseLabel: 'Pause',
|
||||
pauseTitle: 'Pause ongoing upload',
|
||||
uploadLabel: 'Upload',
|
||||
uploadTitle: 'Upload selected files',
|
||||
msgNo: 'No',
|
||||
msgNoFilesSelected: 'No files selected',
|
||||
msgPaused: 'Paused',
|
||||
msgCancelled: 'Cancelled',
|
||||
msgPlaceholder: 'Select {files} ...',
|
||||
msgZoomModalHeading: 'Detailed Preview',
|
||||
msgFileRequired: 'You must select a file to upload.',
|
||||
msgSizeTooSmall: 'File "{name}" (<b>{size}</b>) is too small and must be larger than <b>{minSize}</b>.',
|
||||
msgSizeTooLarge: 'File "{name}" (<b>{size}</b>) exceeds maximum allowed upload size of <b>{maxSize}</b>.',
|
||||
msgFilesTooLess: 'You must select at least <b>{n}</b> {files} to upload.',
|
||||
msgFilesTooMany: 'Number of files selected for upload <b>({n})</b> exceeds maximum allowed limit of <b>{m}</b>.',
|
||||
msgTotalFilesTooMany: 'You can upload a maximum of <b>{m}</b> files (<b>{n}</b> files detected).',
|
||||
msgFileNotFound: 'File "{name}" not found!',
|
||||
msgFileSecured: 'Security restrictions prevent reading the file "{name}".',
|
||||
msgFileNotReadable: 'File "{name}" is not readable.',
|
||||
msgFilePreviewAborted: 'File preview aborted for "{name}".',
|
||||
msgFilePreviewError: 'An error occurred while reading the file "{name}".',
|
||||
msgInvalidFileName: 'Invalid or unsupported characters in file name "{name}".',
|
||||
msgInvalidFileType: 'Invalid type for file "{name}". Only "{types}" files are supported.',
|
||||
msgInvalidFileExtension: 'Invalid extension for file "{name}". Only "{extensions}" files are supported.',
|
||||
msgFileTypes: {
|
||||
'image': 'image',
|
||||
'html': 'HTML',
|
||||
'text': 'text',
|
||||
'video': 'video',
|
||||
'audio': 'audio',
|
||||
'flash': 'flash',
|
||||
'pdf': 'PDF',
|
||||
'object': 'object'
|
||||
},
|
||||
msgUploadAborted: 'The file upload was aborted',
|
||||
msgUploadThreshold: 'Processing …',
|
||||
msgUploadBegin: 'Initializing …',
|
||||
msgUploadEnd: 'Done',
|
||||
msgUploadResume: 'Resuming upload …',
|
||||
msgUploadEmpty: 'No valid data available for upload.',
|
||||
msgUploadError: 'Upload Error',
|
||||
msgDeleteError: 'Delete Error',
|
||||
msgProgressError: 'Error',
|
||||
msgValidationError: 'Validation Error',
|
||||
msgLoading: 'Loading file {index} of {files} …',
|
||||
msgProgress: 'Loading file {index} of {files} - {name} - {percent}% completed.',
|
||||
msgSelected: '{n} {files} selected',
|
||||
msgProcessing: 'Processing ...',
|
||||
msgFoldersNotAllowed: 'Drag & drop files only! Skipped {n} dropped folder(s).',
|
||||
msgImageWidthSmall: 'Width of image file "{name}" must be at least <b>{size} px</b> (detected <b>{dimension} px</b>).',
|
||||
msgImageHeightSmall: 'Height of image file "{name}" must be at least <b>{size} px</b> (detected <b>{dimension} px</b>).',
|
||||
msgImageWidthLarge: 'Width of image file "{name}" cannot exceed <b>{size} px</b> (detected <b>{dimension} px</b>).',
|
||||
msgImageHeightLarge: 'Height of image file "{name}" cannot exceed <b>{size} px</b> (detected <b>{dimension} px</b>).',
|
||||
msgImageResizeError: 'Could not get the image dimensions to resize.',
|
||||
msgImageResizeException: 'Error while resizing the image.<pre>{errors}</pre>',
|
||||
msgAjaxError: 'Something went wrong with the {operation} operation. Please try again later!',
|
||||
msgAjaxProgressError: '{operation} failed',
|
||||
msgDuplicateFile: 'File "{name}" of same size "{size}" has already been selected earlier. Skipping duplicate selection.',
|
||||
msgResumableUploadRetriesExceeded: 'Upload aborted beyond <b>{max}</b> retries for file <b>{file}</b>! Error Details: <pre>{error}</pre>',
|
||||
msgPendingTime: '{time} remaining',
|
||||
msgCalculatingTime: 'calculating time remaining',
|
||||
ajaxOperations: {
|
||||
deleteThumb: 'file delete',
|
||||
uploadThumb: 'file upload',
|
||||
uploadBatch: 'batch file upload',
|
||||
uploadExtra: 'form data upload'
|
||||
},
|
||||
dropZoneTitle: 'Drag & drop files here …',
|
||||
dropZoneClickTitle: '<br>(or click to select {files})',
|
||||
fileActionSettings: {
|
||||
removeTitle: 'Remove file',
|
||||
uploadTitle: 'Upload file',
|
||||
uploadRetryTitle: 'Retry upload',
|
||||
downloadTitle: 'Download file',
|
||||
rotateTitle: 'Rotate 90 deg. clockwise',
|
||||
zoomTitle: 'View details',
|
||||
dragTitle: 'Move / Rearrange',
|
||||
indicatorNewTitle: 'Not uploaded yet',
|
||||
indicatorSuccessTitle: 'Uploaded',
|
||||
indicatorErrorTitle: 'Upload Error',
|
||||
indicatorPausedTitle: 'Upload Paused',
|
||||
indicatorLoadingTitle: 'Uploading …'
|
||||
},
|
||||
previewZoomButtonTitles: {
|
||||
prev: 'View previous file',
|
||||
next: 'View next file',
|
||||
rotate: 'Rotate 90 deg. clockwise',
|
||||
toggleheader: 'Toggle header',
|
||||
fullscreen: 'Toggle full screen',
|
||||
borderless: 'Toggle borderless mode',
|
||||
close: 'Close detailed preview'
|
||||
}
|
||||
};
|
||||
}));
|
|
@ -0,0 +1,128 @@
|
|||
/*!
|
||||
* FileInput Chinese Traditional Translations
|
||||
*
|
||||
* This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or
|
||||
* any HTML markup tags in the messages must not be converted or translated.
|
||||
*
|
||||
* @see http://github.com/kartik-v/bootstrap-fileinput
|
||||
* @author kangqf <kangqingfei@gmail.com>
|
||||
*
|
||||
* NOTE: this file must be saved in UTF-8 encoding.
|
||||
*/
|
||||
(function (factory) {
|
||||
'use strict';
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
factory(window.jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.fileinputLocales['zh-TW'] = {
|
||||
sizeUnits: ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
||||
bitRateUnits: ['B/s', 'KB/s', 'MB/s', 'GB/s', 'TB/s', 'PB/s', 'EB/s', 'ZB/s', 'YB/s'],
|
||||
fileSingle: '單一檔案',
|
||||
filePlural: '複選檔案',
|
||||
browseLabel: '瀏覽 …',
|
||||
removeLabel: '移除',
|
||||
removeTitle: '清除選取檔案',
|
||||
cancelLabel: '取消',
|
||||
cancelTitle: '取消上傳中檔案',
|
||||
pauseLabel: 'Pause',
|
||||
pauseTitle: 'Pause ongoing upload',
|
||||
uploadLabel: '上傳',
|
||||
uploadTitle: '上傳選取檔案',
|
||||
msgNo: '沒有',
|
||||
msgNoFilesSelected: '未選擇檔案',
|
||||
msgPaused: 'Paused',
|
||||
msgCancelled: '取消',
|
||||
zoomTitle: '詳細資料',
|
||||
msgPlaceholder: '選擇 {files} ...',
|
||||
msgZoomModalHeading: '內容預覽',
|
||||
msgFileRequired: '必須選擇壹個文件上傳.',
|
||||
msgSizeTooSmall: '檔案 "{name}" (<b>{size}</b>) 必須大於限定大小 <b>{minSize}</b>.',
|
||||
msgSizeTooLarge: '檔案 "{name}" (<b>{size}</b>) 大小超過上限 <b>{maxSize}</b>.',
|
||||
msgFilesTooLess: '最少必須選擇 <b>{n}</b> {files} 來上傳. ',
|
||||
msgFilesTooMany: '上傳的檔案數量 <b>({n})</b> 超過最大檔案上傳限制 <b>{m}</b>.',
|
||||
msgTotalFilesTooMany: 'You can upload a maximum of <b>{m}</b> files (<b>{n}</b> files detected).',
|
||||
msgFileNotFound: '檔案 "{name}" 未發現!',
|
||||
msgFileSecured: '安全限制,禁止讀取檔案 "{name}".',
|
||||
msgFileNotReadable: '文件 "{name}" 不可讀取.',
|
||||
msgFilePreviewAborted: '檔案 "{name}" 預覽中止.',
|
||||
msgFilePreviewError: '讀取 "{name}" 發生錯誤.',
|
||||
msgInvalidFileName: '附檔名 "{name}" 包含非法字符.',
|
||||
msgInvalidFileType: '檔案類型錯誤 "{name}". 只能使用 "{types}" 類型的檔案.',
|
||||
msgInvalidFileExtension: '附檔名錯誤 "{name}". 只能使用 "{extensions}" 的檔案.',
|
||||
msgFileTypes: {
|
||||
'image': 'image',
|
||||
'html': 'HTML',
|
||||
'text': 'text',
|
||||
'video': 'video',
|
||||
'audio': 'audio',
|
||||
'flash': 'flash',
|
||||
'pdf': 'PDF',
|
||||
'object': 'object'
|
||||
},
|
||||
msgUploadAborted: '該文件上傳被中止',
|
||||
msgUploadThreshold: '處理中 …',
|
||||
msgUploadBegin: '正在初始化 …',
|
||||
msgUploadEnd: '完成',
|
||||
msgUploadResume: 'Resuming upload …',
|
||||
msgUploadEmpty: '無效的文件上傳.',
|
||||
msgUploadError: 'Upload Error',
|
||||
msgDeleteError: 'Delete Error',
|
||||
msgProgressError: '上傳錯誤',
|
||||
msgValidationError: '驗證錯誤',
|
||||
msgLoading: '載入第 {index} 個檔案,共 {files} …',
|
||||
msgProgress: '載入第 {index} 個檔案,共 {files} - {name} - {percent}% 成功.',
|
||||
msgSelected: '{n} {files} 選取',
|
||||
msgProcessing: 'Processing ...',
|
||||
msgFoldersNotAllowed: '只支援單檔拖曳! 無法使用 {n} 拖拽的資料夹.',
|
||||
msgImageWidthSmall: '圖檔寬度"{name}"必須至少為{size}像素(px).',
|
||||
msgImageHeightSmall: '圖檔高度"{name}"必須至少為{size}像素(px).',
|
||||
msgImageWidthLarge: '圖檔寬度"{name}"不能超過{size}像素(px).',
|
||||
msgImageHeightLarge: '圖檔高度"{name}"不能超過{size}像素(px).',
|
||||
msgImageResizeError: '無法獲取的圖像尺寸調整。',
|
||||
msgImageResizeException: '錯誤而調整圖像大小。<pre>{errors}</pre>',
|
||||
msgAjaxError: '{operation} 發生錯誤. 請重試!',
|
||||
msgAjaxProgressError: '{operation} 失敗',
|
||||
msgDuplicateFile: 'File "{name}" of same size "{size}" has already been selected earlier. Skipping duplicate selection.',
|
||||
msgResumableUploadRetriesExceeded: 'Upload aborted beyond <b>{max}</b> retries for file <b>{file}</b>! Error Details: <pre>{error}</pre>',
|
||||
msgPendingTime: '{time} remaining',
|
||||
msgCalculatingTime: 'calculating time remaining',
|
||||
ajaxOperations: {
|
||||
deleteThumb: 'file delete',
|
||||
uploadThumb: 'file upload',
|
||||
uploadBatch: 'batch file upload',
|
||||
uploadExtra: 'form data upload'
|
||||
},
|
||||
dropZoneTitle: '拖曳檔案至此 …',
|
||||
dropZoneClickTitle: '<br>(或點擊{files}按鈕選擇文件)',
|
||||
fileActionSettings: {
|
||||
removeTitle: '刪除檔案',
|
||||
uploadTitle: '上傳檔案',
|
||||
uploadRetryTitle: '重試',
|
||||
downloadTitle: '下載檔案',
|
||||
rotateTitle: 'Rotate 90 deg. clockwise',
|
||||
zoomTitle: '詳細資料',
|
||||
dragTitle: '移動 / 重置',
|
||||
indicatorNewTitle: '尚未上傳',
|
||||
indicatorSuccessTitle: '上傳成功',
|
||||
indicatorErrorTitle: '上傳失敗',
|
||||
indicatorPausedTitle: 'Upload Paused',
|
||||
indicatorLoadingTitle: '上傳中 …'
|
||||
},
|
||||
previewZoomButtonTitles: {
|
||||
prev: '預覽上壹個文件',
|
||||
next: '預覽下壹個文件',
|
||||
rotate: 'Rotate 90 deg. clockwise',
|
||||
toggleheader: '縮放',
|
||||
fullscreen: '全屏',
|
||||
borderless: '無邊界模式',
|
||||
close: '關閉當前預覽'
|
||||
}
|
||||
};
|
||||
}));
|
|
@ -0,0 +1,128 @@
|
|||
/*!
|
||||
* FileInput Chinese Translations
|
||||
*
|
||||
* This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or
|
||||
* any HTML markup tags in the messages must not be converted or translated.
|
||||
*
|
||||
* @see http://github.com/kartik-v/bootstrap-fileinput
|
||||
* @author kangqf <kangqingfei@gmail.com>
|
||||
*
|
||||
* NOTE: this file must be saved in UTF-8 encoding.
|
||||
*/
|
||||
import jquery from "../../../jquery/jquery.esm.js";
|
||||
(function (factory) {
|
||||
'use strict';
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
factory(jquery);
|
||||
}
|
||||
}(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.fileinputLocales['zh'] = {
|
||||
sizeUnits: ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
||||
bitRateUnits: ['B/s', 'KB/s', 'MB/s', 'GB/s', 'TB/s', 'PB/s', 'EB/s', 'ZB/s', 'YB/s'],
|
||||
fileSingle: '文件',
|
||||
filePlural: '个文件',
|
||||
browseLabel: '选择 …',
|
||||
removeLabel: '移除',
|
||||
removeTitle: '清除选中文件',
|
||||
cancelLabel: '取消',
|
||||
cancelTitle: '取消进行中的上传',
|
||||
pauseLabel: '暂停',
|
||||
pauseTitle: '暂停上传',
|
||||
uploadLabel: '上传',
|
||||
uploadTitle: '上传选中文件',
|
||||
msgNo: '没有',
|
||||
msgNoFilesSelected: '未选择文件',
|
||||
msgPaused: '已暂停',
|
||||
msgCancelled: '取消',
|
||||
msgPlaceholder: '选择 {files} ...',
|
||||
msgZoomModalHeading: '详细预览',
|
||||
msgFileRequired: '必须选择一个文件上传.',
|
||||
msgSizeTooSmall: '文件 "{name}" (<b>{size}</b>) 必须大于限定大小 <b>{minSize}</b>.',
|
||||
msgSizeTooLarge: '文件 "{name}" (<b>{size}</b>) 超过了允许大小 <b>{maxSize}</b>.',
|
||||
msgFilesTooLess: '你必须选择最少 <b>{n}</b> {files} 来上传. ',
|
||||
msgFilesTooMany: '选择的上传文件个数 <b>({n})</b> 超出最大文件的限制个数 <b>{m}</b>.',
|
||||
msgTotalFilesTooMany: '你最多可以上传 <b>{m}</b> 个文件 (当前有<b>{n}</b> 个文件).',
|
||||
msgFileNotFound: '文件 "{name}" 未找到!',
|
||||
msgFileSecured: '安全限制,为了防止读取文件 "{name}".',
|
||||
msgFileNotReadable: '文件 "{name}" 不可读.',
|
||||
msgFilePreviewAborted: '取消 "{name}" 的预览.',
|
||||
msgFilePreviewError: '读取 "{name}" 时出现了一个错误.',
|
||||
msgInvalidFileName: '文件名 "{name}" 包含非法字符.',
|
||||
msgInvalidFileType: '不正确的类型 "{name}". 只支持 "{types}" 类型的文件.',
|
||||
msgInvalidFileExtension: '不正确的文件扩展名 "{name}". 只支持 "{extensions}" 的文件扩展名.',
|
||||
msgFileTypes: {
|
||||
'image': 'image',
|
||||
'html': 'HTML',
|
||||
'text': 'text',
|
||||
'video': 'video',
|
||||
'audio': 'audio',
|
||||
'flash': 'flash',
|
||||
'pdf': 'PDF',
|
||||
'object': 'object'
|
||||
},
|
||||
msgUploadAborted: '该文件上传被中止',
|
||||
msgUploadThreshold: '处理中 …',
|
||||
msgUploadBegin: '正在初始化 …',
|
||||
msgUploadEnd: '完成',
|
||||
msgUploadResume: '继续上传 …',
|
||||
msgUploadEmpty: '无效的文件上传.',
|
||||
msgUploadError: '上传出错',
|
||||
msgDeleteError: '删除出错',
|
||||
msgProgressError: '上传出错',
|
||||
msgValidationError: '验证错误',
|
||||
msgLoading: '加载第 {index} 文件 共 {files} …',
|
||||
msgProgress: '加载第 {index} 文件 共 {files} - {name} - {percent}% 完成.',
|
||||
msgSelected: '{n} {files} 选中',
|
||||
msgProcessing: '处理中 ...',
|
||||
msgFoldersNotAllowed: '只支持拖拽文件! 跳过 {n} 拖拽的文件夹.',
|
||||
msgImageWidthSmall: '图像文件的"{name}"的宽度必须是至少{size}像素.',
|
||||
msgImageHeightSmall: '图像文件的"{name}"的高度必须至少为{size}像素.',
|
||||
msgImageWidthLarge: '图像文件"{name}"的宽度不能超过{size}像素.',
|
||||
msgImageHeightLarge: '图像文件"{name}"的高度不能超过{size}像素.',
|
||||
msgImageResizeError: '无法获取的图像尺寸调整。',
|
||||
msgImageResizeException: '调整图像大小时发生错误。<pre>{errors}</pre>',
|
||||
msgAjaxError: '{operation} 发生错误. 请重试!',
|
||||
msgAjaxProgressError: '{operation} 失败',
|
||||
msgDuplicateFile: '文件 "{name}",大小 "{size}" 已经被选中.忽略相同的文件.',
|
||||
msgResumableUploadRetriesExceeded: '文件 <b>{file}</b> 上传失败超过 <b>{max}</b> 次重试 ! 错误详情: <pre>{error}</pre>',
|
||||
msgPendingTime: '{time} 剩余',
|
||||
msgCalculatingTime: '计算剩余时间',
|
||||
ajaxOperations: {
|
||||
deleteThumb: '删除文件',
|
||||
uploadThumb: '上传文件',
|
||||
uploadBatch: '批量上传',
|
||||
uploadExtra: '表单数据上传'
|
||||
},
|
||||
dropZoneTitle: '拖拽文件到这里 …<br>支持多文件同时上传',
|
||||
dropZoneClickTitle: '<br>(或点击{files}按钮选择文件)',
|
||||
fileActionSettings: {
|
||||
removeTitle: '删除文件',
|
||||
uploadTitle: '上传文件',
|
||||
downloadTitle: '下载文件',
|
||||
uploadRetryTitle: '重试',
|
||||
rotateTitle: '顺时针旋转90度',
|
||||
zoomTitle: '查看详情',
|
||||
dragTitle: '移动 / 重置',
|
||||
indicatorNewTitle: '没有上传',
|
||||
indicatorSuccessTitle: '上传',
|
||||
indicatorErrorTitle: '上传错误',
|
||||
indicatorPausedTitle: '上传已暂停',
|
||||
indicatorLoadingTitle: '上传 …'
|
||||
},
|
||||
previewZoomButtonTitles: {
|
||||
prev: '预览上一个文件',
|
||||
next: '预览下一个文件',
|
||||
rotate: '顺时针旋转90度',
|
||||
toggleheader: '缩放',
|
||||
fullscreen: '全屏',
|
||||
borderless: '无边界模式',
|
||||
close: '关闭当前预览'
|
||||
}
|
||||
};
|
||||
}));
|
|
@ -0,0 +1,60 @@
|
|||
/*!
|
||||
* bootstrap-fileinput v5.5.0
|
||||
* http://plugins.krajee.com/file-input
|
||||
*
|
||||
* Font Awesome 6.x icon theme configuration for bootstrap-fileinput. Requires font awesome 6 assets to be loaded.
|
||||
*
|
||||
* Author: Kartik Visweswaran
|
||||
* Copyright: 2014 - 2022, Kartik Visweswaran, Krajee.com
|
||||
*
|
||||
* Licensed under the BSD-3-Clause
|
||||
* https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
|
||||
*/
|
||||
(function (factory) {
|
||||
'use strict';
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery'],factory);
|
||||
} else if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
factory(window.jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.fileinputThemes.fa6 = {
|
||||
fileActionSettings: {
|
||||
removeIcon: '<i class="fa-regular fa-trash-can"></i>',
|
||||
uploadIcon: '<i class="fa-solid fa-upload"></i>',
|
||||
uploadRetryIcon: '<i class="fa-solid fa-cloud-arrow-up"></i>',
|
||||
downloadIcon: '<i class="fa-solid fa-download"></i>',
|
||||
rotateIcon: '<i class="fa-solid fa-rotate-right"></i>',
|
||||
zoomIcon: '<i class="fa-solid fa-magnifying-glass-plus"></i>',
|
||||
dragIcon: '<i class="fa-solid fa-arrows-up-down-left-right"></i>',
|
||||
indicatorNew: '<i class="fa-solid fa-circle-plus text-warning"></i>',
|
||||
indicatorSuccess: '<i class="fa-solid fa-circle-check text-success"></i>',
|
||||
indicatorError: '<i class="fa-solid fa-circle-exclamation text-danger"></i>',
|
||||
indicatorLoading: '<i class="fa-solid fa-hourglass text-muted"></i>',
|
||||
indicatorPaused: '<i class="fa fa-pause text-info"></i>'
|
||||
},
|
||||
layoutTemplates: {
|
||||
fileIcon: '<i class="fa-solid fa-file kv-caption-icon"></i> '
|
||||
},
|
||||
previewZoomButtonIcons: {
|
||||
prev: '<i class="fa-solid fa-chevron-left fa-fw"></i>',
|
||||
next: '<i class="fa-solid fa-chevron-right fa-fw"></i>',
|
||||
rotate: '<i class="fa-solid fa-rotate-right fa-fw"></i>',
|
||||
toggleheader: '<i class="fa-solid fa-arrows-up-down fa-fw"></i>',
|
||||
fullscreen: '<i class="fa-solid fa-maximize fa-fw"></i>',
|
||||
borderless: '<i class="fa-solid fa-arrow-up-right-from-square fa-fw"></i>',
|
||||
close: '<i class="fa-solid fa-fw fa-xmark fa-fw"></i>'
|
||||
},
|
||||
previewFileIcon: '<i class="fa-solid fa-file"></i>',
|
||||
browseIcon: '<i class="fa-solid fa-folder-open"></i>',
|
||||
removeIcon: '<i class="fa-regular fa-trash-can"></i>',
|
||||
cancelIcon: '<i class="fa-solid fa-ban"></i>',
|
||||
pauseIcon: '<i class="fa-solid fa-pause"></i>',
|
||||
uploadIcon: '<i class="fa-solid fa-upload"></i>',
|
||||
msgValidationErrorIcon: '<i class="fa-solid fa-circle-exclamation"></i> '
|
||||
};
|
||||
}));
|
|
@ -0,0 +1,14 @@
|
|||
/*!
|
||||
* bootstrap-fileinput v5.5.0
|
||||
* http://plugins.krajee.com/file-input
|
||||
*
|
||||
* Font Awesome 6 icon theme configuration for bootstrap-fileinput. Requires font awesome 6 assets to be loaded.
|
||||
*
|
||||
* Author: Kartik Visweswaran
|
||||
* Copyright: 2014 - 2022, Kartik Visweswaran, Krajee.com
|
||||
*
|
||||
* Licensed under the BSD-3-Clause
|
||||
* https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
|
||||
*/
|
||||
import jquery from "../../../jquery/jquery.esm.js";
|
||||
!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof module&&"object"==typeof module.exports?require("jquery"):jquery)}(function(a){"use strict";a.fn.fileinputThemes.fa6={fileActionSettings:{removeIcon:'<i class="fa-regular fa-trash-can"></i>',uploadIcon:'<i class="fa-solid fa-upload"></i>',uploadRetryIcon:'<i class="fa-solid fa-cloud-arrow-up"></i>',downloadIcon:'<i class="fa-solid fa-download"></i>',rotateIcon:'<i class="fa-solid fa-rotate-right"></i>',zoomIcon:'<i class="fa-solid fa-magnifying-glass-plus"></i>',dragIcon:'<i class="fa-solid fa-arrows-up-down-left-right"></i>',indicatorNew:'<i class="fa-solid fa-circle-plus text-warning"></i>',indicatorSuccess:'<i class="fa-solid fa-circle-check text-success"></i>',indicatorError:'<i class="fa-solid fa-circle-exclamation text-danger"></i>',indicatorLoading:'<i class="fa-solid fa-hourglass text-muted"></i>',indicatorPaused:'<i class="fa fa-pause text-info"></i>'},layoutTemplates:{fileIcon:'<i class="fa-solid fa-file kv-caption-icon"></i> '},previewZoomButtonIcons:{prev:'<i class="fa-solid fa-chevron-left fa-fw"></i>',next:'<i class="fa-solid fa-chevron-right fa-fw"></i>',rotate:'<i class="fa-solid fa-rotate-right fa-fw"></i>',toggleheader:'<i class="fa-solid fa-arrows-up-down fa-fw"></i>',fullscreen:'<i class="fa-solid fa-maximize fa-fw"></i>',borderless:'<i class="fa-solid fa-arrow-up-right-from-square fa-fw"></i>',close:'<i class="fa-solid fa-fw fa-xmark fa-fw"></i>'},previewFileIcon:'<i class="fa-solid fa-file"></i>',browseIcon:'<i class="fa-solid fa-folder-open"></i>',removeIcon:'<i class="fa-regular fa-trash-can"></i>',cancelIcon:'<i class="fa-solid fa-ban"></i>',pauseIcon:'<i class="fa-solid fa-pause"></i>',uploadIcon:'<i class="fa-solid fa-upload"></i>',msgValidationErrorIcon:'<i class="fa-solid fa-circle-exclamation"></i> '}});
|
|
@ -0,0 +1,99 @@
|
|||
## Contributing to Flot ##
|
||||
|
||||
We welcome all contributions, but following these guidelines results in less
|
||||
work for us, and a faster and better response.
|
||||
|
||||
### Issues ###
|
||||
|
||||
Issues are not a way to ask general questions about Flot. If you see unexpected
|
||||
behavior but are not 100% certain that it is a bug, please try posting to the
|
||||
[forum](http://groups.google.com/group/flot-graphs) first, and confirm that
|
||||
what you see is really a Flot problem before creating a new issue for it.
|
||||
|
||||
When reporting a bug, please include a working demonstration of the problem, if
|
||||
possible, or at least a clear description of the options you're using and the
|
||||
environment (browser and version, jQuery version, other libraries) that you're
|
||||
running under.
|
||||
|
||||
If you have suggestions for new features, or changes to existing ones, we'd
|
||||
love to hear them! Please submit each suggestion as a separate new issue.
|
||||
|
||||
If you would like to work on an existing issue, please make sure it is not
|
||||
already assigned to someone else. If an issue is assigned to someone, that
|
||||
person has already started working on it. So, pick unassigned issues to prevent
|
||||
duplicated efforts.
|
||||
|
||||
### Pull Requests ###
|
||||
|
||||
To make merging as easy as possible, please keep these rules in mind:
|
||||
|
||||
1. Divide larger changes into a series of small, logical commits with
|
||||
descriptive messages.
|
||||
|
||||
2. Format your code according to the style guidelines below.
|
||||
|
||||
3. Submit new features or architectural changes to the <version>-work branch
|
||||
for the next major release. Submit bug fixes to the master branch.
|
||||
|
||||
4. Rebase, if necessary, before submitting your pull request, to reduce the
|
||||
work we need to do to merge it.
|
||||
|
||||
### Flot Style Guidelines ###
|
||||
|
||||
Flot follows the [jQuery Core Style Guidelines](http://docs.jquery.com/JQuery_Core_Style_Guidelines),
|
||||
with the following updates and exceptions:
|
||||
|
||||
#### Spacing ####
|
||||
|
||||
Do not add horizontal space around parameter lists, loop definitions, or
|
||||
array/object indices. For example:
|
||||
|
||||
```js
|
||||
for ( var i = 0; i < data.length; i++ ) { // This block is wrong!
|
||||
if ( data[ i ] > 1 ) {
|
||||
data[ i ] = 2;
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < data.length; i++) { // This block is correct!
|
||||
if (data[i] > 1) {
|
||||
data[i] = 2;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Comments ####
|
||||
|
||||
Use // for all comments except the header at the top of a file or inline
|
||||
include.
|
||||
|
||||
All // comment blocks should have an empty line above *and* below them. For
|
||||
example:
|
||||
|
||||
```js
|
||||
var a = 5;
|
||||
|
||||
// We're going to loop here
|
||||
// TODO: Make this loop faster, better, stronger!
|
||||
|
||||
for (var x = 0; x < 10; x++) {}
|
||||
```
|
||||
|
||||
#### Wrapping ####
|
||||
|
||||
Block comments should be wrapped at 80 characters.
|
||||
|
||||
Code should attempt to wrap at 80 characters, but may run longer if wrapping
|
||||
would hurt readability more than having to scroll horizontally. This is a
|
||||
judgement call made on a situational basis.
|
||||
|
||||
Statements containing complex logic should not be wrapped arbitrarily if they
|
||||
do not exceed 80 characters. For example:
|
||||
|
||||
```js
|
||||
if (a == 1 && // This block is wrong!
|
||||
b == 2 &&
|
||||
c == 3) {}
|
||||
|
||||
if (a == 1 && b == 2 && c == 3) {} // This block is correct!
|
||||
```
|
|
@ -0,0 +1,75 @@
|
|||
## Frequently asked questions ##
|
||||
|
||||
#### How much data can Flot cope with? ####
|
||||
|
||||
Flot will happily draw everything you send to it so the answer
|
||||
depends on the browser. The excanvas emulation used for IE (built with
|
||||
VML) makes IE by far the slowest browser so be sure to test with that
|
||||
if IE users are in your target group (for large plots in IE, you can
|
||||
also check out Flashcanvas which may be faster).
|
||||
|
||||
1000 points is not a problem, but as soon as you start having more
|
||||
points than the pixel width, you should probably start thinking about
|
||||
downsampling/aggregation as this is near the resolution limit of the
|
||||
chart anyway. If you downsample server-side, you also save bandwidth.
|
||||
|
||||
|
||||
#### Flot isn't working when I'm using JSON data as source! ####
|
||||
|
||||
Actually, Flot loves JSON data, you just got the format wrong.
|
||||
Double check that you're not inputting strings instead of numbers,
|
||||
like [["0", "-2.13"], ["5", "4.3"]]. This is most common mistake, and
|
||||
the error might not show up immediately because Javascript can do some
|
||||
conversion automatically.
|
||||
|
||||
|
||||
#### Can I export the graph? ####
|
||||
|
||||
You can grab the image rendered by the canvas element used by Flot
|
||||
as a PNG or JPEG (remember to set a background). Note that it won't
|
||||
include anything not drawn in the canvas (such as the legend). And it
|
||||
doesn't work with excanvas which uses VML, but you could try
|
||||
Flashcanvas.
|
||||
|
||||
|
||||
#### The bars are all tiny in time mode? ####
|
||||
|
||||
It's not really possible to determine the bar width automatically.
|
||||
So you have to set the width with the barWidth option which is NOT in
|
||||
pixels, but in the units of the x axis (or the y axis for horizontal
|
||||
bars). For time mode that's milliseconds so the default value of 1
|
||||
makes the bars 1 millisecond wide.
|
||||
|
||||
|
||||
#### Can I use Flot with libraries like Mootools or Prototype? ####
|
||||
|
||||
Yes, Flot supports it out of the box and it's easy! Just use jQuery
|
||||
instead of $, e.g. call jQuery.plot instead of $.plot and use
|
||||
jQuery(something) instead of $(something). As a convenience, you can
|
||||
put in a DOM element for the graph placeholder where the examples and
|
||||
the API documentation are using jQuery objects.
|
||||
|
||||
Depending on how you include jQuery, you may have to add one line of
|
||||
code to prevent jQuery from overwriting functions from the other
|
||||
libraries, see the documentation in jQuery ("Using jQuery with other
|
||||
libraries") for details.
|
||||
|
||||
|
||||
#### Flot doesn't work with [insert name of Javascript UI framework]! ####
|
||||
|
||||
Flot is using standard HTML to make charts. If this is not working,
|
||||
it's probably because the framework you're using is doing something
|
||||
weird with the DOM or with the CSS that is interfering with Flot.
|
||||
|
||||
A common problem is that there's display:none on a container until the
|
||||
user does something. Many tab widgets work this way, and there's
|
||||
nothing wrong with it - you just can't call Flot inside a display:none
|
||||
container as explained in the README so you need to hold off the Flot
|
||||
call until the container is actually displayed (or use
|
||||
visibility:hidden instead of display:none or move the container
|
||||
off-screen).
|
||||
|
||||
If you find there's a specific thing we can do to Flot to help, feel
|
||||
free to submit a bug report. Otherwise, you're welcome to ask for help
|
||||
on the forum/mailing list, but please don't submit a bug report to
|
||||
Flot.
|
|
@ -0,0 +1,22 @@
|
|||
Copyright (c) 2007-2013 IOLA and Ole Laursen
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -0,0 +1,12 @@
|
|||
# Makefile for generating minified files
|
||||
|
||||
.PHONY: all
|
||||
|
||||
# we cheat and process all .js files instead of an exhaustive list
|
||||
all: $(patsubst %.js,%.min.js,$(filter-out %.min.js,$(wildcard *.js)))
|
||||
|
||||
%.min.js: %.js
|
||||
yui-compressor $< -o $@
|
||||
|
||||
test:
|
||||
./node_modules/.bin/jshint *jquery.flot.js
|
|
@ -0,0 +1,893 @@
|
|||
## Flot 0.8.1 ##
|
||||
|
||||
### Bug fixes ###
|
||||
|
||||
- Fixed a regression in the time plugin, introduced in 0.8, that caused dates
|
||||
to align to the minute rather than to the highest appropriate unit. This
|
||||
caused many x-axes in 0.8 to have different ticks than they did in 0.7.
|
||||
(reported by Tom Sheppard, patch by Daniel Shapiro, issue #1017, pull
|
||||
request #1023)
|
||||
|
||||
- Fixed a regression in text rendering, introduced in 0.8, that caused axis
|
||||
labels with the same text as another label on the same axis to disappear.
|
||||
More generally, it's again possible to have the same text in two locations.
|
||||
(issue #1032)
|
||||
|
||||
- Fixed a regression in text rendering, introduced in 0.8, where axis labels
|
||||
were no longer assigned an explicit width, and their text could not wrap.
|
||||
(reported by sabregreen, issue #1019)
|
||||
|
||||
- Fixed a regression in the pie plugin, introduced in 0.8, that prevented it
|
||||
from accepting data in the format '[[x, y]]'.
|
||||
(patch by Nicolas Morel, pull request #1024)
|
||||
|
||||
- The 'zero' series option and 'autoscale' format option are no longer
|
||||
ignored when the series contains a null value.
|
||||
(reported by Daniel Shapiro, issue #1033)
|
||||
|
||||
- Avoid triggering the time-mode plugin exception when there are zero series.
|
||||
(reported by Daniel Rothig, patch by Mark Raymond, issue #1016)
|
||||
|
||||
- When a custom color palette has fewer colors than the default palette, Flot
|
||||
no longer fills out the colors with the remainder of the default.
|
||||
(patch by goorpy, issue #1031, pull request #1034)
|
||||
|
||||
- Fixed missing update for bar highlights after a zoom or other redraw.
|
||||
(reported by Paolo Valleri, issue #1030)
|
||||
|
||||
- Fixed compatibility with jQuery versions earlier than 1.7.
|
||||
(patch by Lee Willis, issue #1027, pull request #1027)
|
||||
|
||||
- The mouse wheel no longer scrolls the page when using the navigate plugin.
|
||||
(patch by vird, pull request #1020)
|
||||
|
||||
- Fixed missing semicolons in the core library.
|
||||
(reported by Michal Zglinski)
|
||||
|
||||
|
||||
## Flot 0.8.0 ##
|
||||
|
||||
### API changes ###
|
||||
|
||||
Support for time series has been moved into a plugin, jquery.flot.time.js.
|
||||
This results in less code if time series are not used. The functionality
|
||||
remains the same (plus timezone support, as described below); however, the
|
||||
plugin must be included if axis.mode is set to "time".
|
||||
|
||||
When the axis mode is "time", the axis option "timezone" can be set to null,
|
||||
"browser", or a particular timezone (e.g. "America/New_York") to control how
|
||||
the dates are displayed. If null, the dates are displayed as UTC. If
|
||||
"browser", the dates are displayed in the time zone of the user's browser.
|
||||
|
||||
Date/time formatting has changed and now follows a proper subset of the
|
||||
standard strftime specifiers, plus one nonstandard specifier for quarters.
|
||||
Additionally, if a strftime function is found in the Date object's prototype,
|
||||
it will be used instead of the built-in formatter.
|
||||
|
||||
Axis tick labels now use the class 'flot-tick-label' instead of 'tickLabel'.
|
||||
The text containers for each axis now use the classes 'flot-[x|y]-axis' and
|
||||
'flot-[x|y]#-axis' instead of '[x|y]Axis' and '[x|y]#Axis'. For compatibility
|
||||
with Flot 0.7 and earlier text will continue to use the old classes as well,
|
||||
but they are considered deprecated and will be removed in a future version.
|
||||
|
||||
In previous versions the axis 'color' option was used to set the color of tick
|
||||
marks and their label text. It now controls the color of the axis line, which
|
||||
previously could not be changed separately, and continues to act as a default
|
||||
for the tick-mark color. The color of tick label text is now set either by
|
||||
overriding the 'flot-tick-label' CSS rule or via the axis 'font' option.
|
||||
|
||||
A new plugin, jquery.flot.canvas.js, allows axis tick labels to be rendered
|
||||
directly to the canvas, rather than using HTML elements. This feature can be
|
||||
toggled with a simple option, making it easy to create interactive plots in the
|
||||
browser using HTML, then re-render them to canvas for export as an image.
|
||||
|
||||
The plugin tries to remain as faithful as possible to the original HTML render,
|
||||
and goes so far as to automatically extract styles from CSS, to avoid having to
|
||||
provide a separate set of styles when rendering to canvas. Due to limitations
|
||||
of the canvas text API, the plugin cannot reproduce certain features, including
|
||||
HTML markup embedded in labels, and advanced text styles such as 'em' units.
|
||||
|
||||
The plugin requires support for canvas text, which may not be present in some
|
||||
older browsers, even if they support the canvas tag itself. To use the plugin
|
||||
with these browsers try using a shim such as canvas-text or FlashCanvas.
|
||||
|
||||
The base and overlay canvas are now using the CSS classes "flot-base" and
|
||||
"flot-overlay" to prevent accidental clashes (issue 540).
|
||||
|
||||
### Changes ###
|
||||
|
||||
- Addition of nonstandard %q specifier to date/time formatting. (patch
|
||||
by risicle, issue 49)
|
||||
|
||||
- Date/time formatting follows proper subset of strftime specifiers, and
|
||||
support added for Date.prototype.strftime, if found. (patch by Mark Cote,
|
||||
issues 419 and 558)
|
||||
|
||||
- Fixed display of year ticks. (patch by Mark Cote, issue 195)
|
||||
|
||||
- Support for time series moved to plugin. (patch by Mark Cote)
|
||||
|
||||
- Display time series in different time zones. (patch by Knut Forkalsrud,
|
||||
issue 141)
|
||||
|
||||
- Added a canvas plugin to enable rendering axis tick labels to the canvas.
|
||||
(sponsored by YCharts.com, implementation by Ole Laursen and David Schnur)
|
||||
|
||||
- Support for setting the interval between redraws of the overlay canvas with
|
||||
redrawOverlayInterval. (suggested in issue 185)
|
||||
|
||||
- Support for multiple thresholds in thresholds plugin. (patch by Arnaud
|
||||
Bellec, issue 523)
|
||||
|
||||
- Support for plotting categories/textual data directly with new categories
|
||||
plugin.
|
||||
|
||||
- Tick generators now get the whole axis rather than just min/max.
|
||||
|
||||
- Added processOffset and drawBackground hooks. (suggested in issue 639)
|
||||
|
||||
- Added a grid "margin" option to set the space between the canvas edge and
|
||||
the grid.
|
||||
|
||||
- Prevent the pie example page from generating single-slice pies. (patch by
|
||||
Shane Reustle)
|
||||
|
||||
- In addition to "left" and "center", bars now recognize "right" as an
|
||||
alignment option. (patch by Michael Mayer, issue 520)
|
||||
|
||||
- Switched from toFixed to a much faster default tickFormatter. (patch by
|
||||
Clemens Stolle)
|
||||
|
||||
- Added to a more helpful error when using a time-mode axis without including
|
||||
the flot.time plugin. (patch by Yael Elmatad)
|
||||
|
||||
- Added a legend "sorted" option to control sorting of legend entries
|
||||
independent of their series order. (patch by Tom Cleaveland)
|
||||
|
||||
- Added a series "highlightColor" option to control the color of the
|
||||
translucent overlay that identifies the dataset when the mouse hovers over
|
||||
it. (patch by Eric Wendelin and Nate Abele, issues 168 and 299)
|
||||
|
||||
- Added a plugin jquery.flot.errorbars, with an accompanying example, that
|
||||
adds the ability to plot error bars, commonly used in many kinds of
|
||||
statistical data visualizations. (patch by Rui Pereira, issue 215)
|
||||
|
||||
- The legend now omits entries whose labelFormatter returns null. (patch by
|
||||
Tom Cleaveland, Christopher Lambert, and Simon Strandgaard)
|
||||
|
||||
- Added support for high pixel density (retina) displays, resulting in much
|
||||
crisper charts on such devices. (patch by Olivier Guerriat, additional
|
||||
fixes by Julien Thomas, maimairel, and Lau Bech Lauritzen)
|
||||
|
||||
- Added the ability to control pie shadow position and alpha via a new pie
|
||||
'shadow' option. (patch by Julien Thomas, pull request #78)
|
||||
|
||||
- Added the ability to set width and color for individual sides of the grid.
|
||||
(patch by Ara Anjargolian, additional fixes by Karl Swedberg, pull requests #855
|
||||
and #880)
|
||||
|
||||
- The selection plugin's getSelection now returns null when the selection
|
||||
has been cleared. (patch by Nick Campbell, pull request #852)
|
||||
|
||||
- Added a new option called 'zero' to bars and filled lines series, to control
|
||||
whether the y-axis minimum is scaled to fit the data or set to zero.
|
||||
(patch by David Schnur, issues #316, #529, and #856, pull request #911)
|
||||
|
||||
- The plot function is now also a jQuery chainable property.
|
||||
(patch by David Schnur, issues #734 and #816, pull request #953)
|
||||
|
||||
- When only a single pie slice is beneath the combine threshold it is no longer
|
||||
replaced by an 'other' slice. (suggested by Devin Bayer, issue #638)
|
||||
|
||||
- Added lineJoin and minSize options to the selection plugin to control the
|
||||
corner style and minimum size of the selection, respectively.
|
||||
(patch by Ruth Linehan, pull request #963)
|
||||
|
||||
### Bug fixes ###
|
||||
|
||||
- Fix problem with null values and pie plugin. (patch by gcruxifix,
|
||||
issue 500)
|
||||
|
||||
- Fix problem with threshold plugin and bars. (based on patch by
|
||||
kaarlenkaski, issue 348)
|
||||
|
||||
- Fix axis box calculations so the boxes include the outermost part of the
|
||||
labels too.
|
||||
|
||||
- Fix problem with event clicking and hovering in IE 8 by updating Excanvas
|
||||
and removing previous work-around. (test case by Ara Anjargolian)
|
||||
|
||||
- Fix issues with blurry 1px border when some measures aren't integer.
|
||||
(reported by Ara Anjargolian)
|
||||
|
||||
- Fix bug with formats in the data processor. (reported by Peter Hull,
|
||||
issue 534)
|
||||
|
||||
- Prevent i from being declared global in extractRange. (reported by
|
||||
Alexander Obukhov, issue 627)
|
||||
|
||||
- Throw errors in a more cross-browser-compatible manner. (patch by
|
||||
Eddie Kay)
|
||||
|
||||
- Prevent pie slice outlines from being drawn when the stroke width is zero.
|
||||
(reported by Chris Minett, issue 585)
|
||||
|
||||
- Updated the navigate plugin's inline copy of jquery.mousewheel to fix
|
||||
Webkit zoom problems. (reported by Hau Nguyen, issue 685)
|
||||
|
||||
- Axis labels no longer appear as decimals rather than integers in certain
|
||||
cases. (patch by Clemens Stolle, issue 541)
|
||||
|
||||
- Automatic color generation no longer produces only whites and blacks when
|
||||
there are many series. (patch by David Schnur and Tom Cleaveland)
|
||||
|
||||
- Fixed an error when custom tick labels weren't provided as strings. (patch
|
||||
by Shad Downey)
|
||||
|
||||
- Prevented the local insertSteps and fmt variables from becoming global.
|
||||
(first reported by Marc Bennewitz and Szymon Barglowski, patch by Nick
|
||||
Campbell, issues #825 and #831, pull request #851)
|
||||
|
||||
- Prevented several threshold plugin variables from becoming global. (patch
|
||||
by Lasse Dahl Ebert)
|
||||
|
||||
- Fixed various jQuery 1.8 compatibility issues. (issues #814 and #819,
|
||||
pull request #877)
|
||||
|
||||
- Pie charts with a slice equal to or approaching 100% of the pie no longer
|
||||
appear invisible. (patch by David Schnur, issues #444, #658, #726, #824
|
||||
and #850, pull request #879)
|
||||
|
||||
- Prevented several local variables from becoming global. (patch by aaa707)
|
||||
|
||||
- Ensure that the overlay and primary canvases remain aligned. (issue #670,
|
||||
pull request #901)
|
||||
|
||||
- Added support for jQuery 1.9 by removing and replacing uses of $.browser.
|
||||
(analysis and patch by Anthony Ryan, pull request #905)
|
||||
|
||||
- Pie charts no longer disappear when redrawn during a resize or update.
|
||||
(reported by Julien Bec, issue #656, pull request #910)
|
||||
|
||||
- Avoided floating-point precision errors when calculating pie percentages.
|
||||
(patch by James Ward, pull request #918)
|
||||
|
||||
- Fixed compatibility with jQuery 1.2.6, which has no 'mouseleave' shortcut.
|
||||
(reported by Bevan, original pull request #920, replaced by direct patch)
|
||||
|
||||
- Fixed sub-pixel rendering issues with crosshair and selection lines.
|
||||
(patches by alanayoub and Daniel Shapiro, pull requests #17 and #925)
|
||||
|
||||
- Fixed rendering issues when using the threshold plugin with several series.
|
||||
(patch by Ivan Novikov, pull request #934)
|
||||
|
||||
- Pie charts no longer disappear when redrawn after calling setData().
|
||||
(reported by zengge1984 and pareeohnos, issues #810 and #945)
|
||||
|
||||
- Added a work-around for the problem where points with a lineWidth of zero
|
||||
still showed up with a visible line. (reported by SalvoSav, issue #842,
|
||||
patch by Jamie Hamel-Smith, pull request #937)
|
||||
|
||||
- Pie charts now accept values in string form, like other plot types.
|
||||
(reported by laerdal.no, issue #534)
|
||||
|
||||
- Avoid rounding errors in the threshold plugin.
|
||||
(reported by jerikojerk, issue #895)
|
||||
|
||||
- Fixed an error when using the navigate plugin with jQuery 1.9.x or later.
|
||||
(reported by Paolo Valleri, issue #964)
|
||||
|
||||
- Fixed inconsistencies between the highlight and unhighlight functions.
|
||||
(reported by djamshed, issue #987)
|
||||
|
||||
- Fixed recalculation of tickSize and tickDecimals on calls to setupGrid.
|
||||
(patch by thecountofzero, pull request #861, issues #860, #1000)
|
||||
|
||||
|
||||
## Flot 0.7 ##
|
||||
|
||||
### API changes ###
|
||||
|
||||
Multiple axes support. Code using dual axes should be changed from using
|
||||
x2axis/y2axis in the options to using an array (although backwards-
|
||||
compatibility hooks are in place). For instance,
|
||||
|
||||
```js
|
||||
{
|
||||
xaxis: { ... }, x2axis: { ... },
|
||||
yaxis: { ... }, y2axis: { ... }
|
||||
}
|
||||
```
|
||||
|
||||
becomes
|
||||
|
||||
```js
|
||||
{
|
||||
xaxes: [ { ... }, { ... } ],
|
||||
yaxes: [ { ... }, { ... } ]
|
||||
}
|
||||
```
|
||||
|
||||
Note that if you're just using one axis, continue to use the xaxis/yaxis
|
||||
directly (it now sets the default settings for the arrays). Plugins touching
|
||||
the axes must be ported to take the extra axes into account, check the source
|
||||
to see some examples.
|
||||
|
||||
A related change is that the visibility of axes is now auto-detected. So if
|
||||
you were relying on an axis to show up even without any data in the chart, you
|
||||
now need to set the axis "show" option explicitly.
|
||||
|
||||
"tickColor" on the grid options is now deprecated in favour of a corresponding
|
||||
option on the axes, so:
|
||||
|
||||
```js
|
||||
{ grid: { tickColor: "#000" }}
|
||||
```
|
||||
|
||||
becomes
|
||||
|
||||
```js
|
||||
{ xaxis: { tickColor: "#000"}, yaxis: { tickColor: "#000"} }
|
||||
```
|
||||
|
||||
But if you just configure a base color Flot will now autogenerate a tick color
|
||||
by adding transparency. Backwards-compatibility hooks are in place.
|
||||
|
||||
Final note: now that IE 9 is coming out with canvas support, you may want to
|
||||
adapt the excanvas include to skip loading it in IE 9 (the examples have been
|
||||
adapted thanks to Ryley Breiddal). An alternative to excanvas using Flash has
|
||||
also surfaced, if your graphs are slow in IE, you may want to give it a spin:
|
||||
|
||||
http://code.google.com/p/flashcanvas/
|
||||
|
||||
### Changes ###
|
||||
|
||||
- Support for specifying a bottom for each point for line charts when filling
|
||||
them, this means that an arbitrary bottom can be used instead of just the x
|
||||
axis. (based on patches patiently provided by Roman V. Prikhodchenko)
|
||||
|
||||
- New fillbetween plugin that can compute a bottom for a series from another
|
||||
series, useful for filling areas between lines.
|
||||
|
||||
See new example percentiles.html for a use case.
|
||||
|
||||
- More predictable handling of gaps for the stacking plugin, now all
|
||||
undefined ranges are skipped.
|
||||
|
||||
- Stacking plugin can stack horizontal bar charts.
|
||||
|
||||
- Navigate plugin now redraws the plot while panning instead of only after
|
||||
the fact. (raised by lastthemy, issue 235)
|
||||
|
||||
Can be disabled by setting the pan.frameRate option to null.
|
||||
|
||||
- Date formatter now accepts %0m and %0d to get a zero-padded month or day.
|
||||
(issue raised by Maximillian Dornseif)
|
||||
|
||||
- Revamped internals to support an unlimited number of axes, not just dual.
|
||||
(sponsored by Flight Data Services, www.flightdataservices.com)
|
||||
|
||||
- New setting on axes, "tickLength", to control the size of ticks or turn
|
||||
them off without turning off the labels.
|
||||
|
||||
- Axis labels are now put in container divs with classes, for instance labels
|
||||
in the x axes can be reached via ".xAxis .tickLabel".
|
||||
|
||||
- Support for setting the color of an axis. (sponsored by Flight Data
|
||||
Services, www.flightdataservices.com)
|
||||
|
||||
- Tick color is now auto-generated as the base color with some transparency,
|
||||
unless you override it.
|
||||
|
||||
- Support for aligning ticks in the axes with "alignTicksWithAxis" to ensure
|
||||
that they appear next to each other rather than in between, at the expense
|
||||
of possibly awkward tick steps. (sponsored by Flight Data Services,
|
||||
www.flightdataservices.com)
|
||||
|
||||
- Support for customizing the point type through a callback when plotting
|
||||
points and new symbol plugin with some predefined point types. (sponsored
|
||||
by Utility Data Corporation)
|
||||
|
||||
- Resize plugin for automatically redrawing when the placeholder changes
|
||||
size, e.g. on window resizes. (sponsored by Novus Partners)
|
||||
|
||||
A resize() method has been added to plot object facilitate this.
|
||||
|
||||
- Support Infinity/-Infinity for plotting asymptotes by hacking it into
|
||||
+/-Number.MAX_VALUE. (reported by rabaea.mircea)
|
||||
|
||||
- Support for restricting navigate plugin to not pan/zoom an axis. (based on
|
||||
patch by kkaefer)
|
||||
|
||||
- Support for providing the drag cursor for the navigate plugin as an option.
|
||||
(based on patch by Kelly T. Moore)
|
||||
|
||||
- Options for controlling whether an axis is shown or not (suggestion by Timo
|
||||
Tuominen) and whether to reserve space for it even if it isn't shown.
|
||||
|
||||
- New attribute $.plot.version with the Flot version as a string.
|
||||
|
||||
- The version comment is now included in the minified jquery.flot.min.js.
|
||||
|
||||
- New options.grid.minBorderMargin for adjusting the minimum margin provided
|
||||
around the border (based on patch by corani, issue 188).
|
||||
|
||||
- Refactor replot behaviour so Flot tries to reuse the existing canvas,
|
||||
adding shutdown() methods to the plot. (based on patch by Ryley Breiddal,
|
||||
issue 269)
|
||||
|
||||
This prevents a memory leak in Chrome and hopefully makes replotting faster
|
||||
for those who are using $.plot instead of .setData()/.draw(). Also update
|
||||
jQuery to 1.5.1 to prevent IE leaks fixed in jQuery.
|
||||
|
||||
- New real-time line chart example.
|
||||
|
||||
- New hooks: drawSeries, shutdown.
|
||||
|
||||
### Bug fixes ###
|
||||
|
||||
- Fixed problem with findNearbyItem and bars on top of each other. (reported
|
||||
by ragingchikn, issue 242)
|
||||
|
||||
- Fixed problem with ticks and the border. (based on patch from
|
||||
ultimatehustler69, issue 236)
|
||||
|
||||
- Fixed problem with plugins adding options to the series objects.
|
||||
|
||||
- Fixed a problem introduced in 0.6 with specifying a gradient with:
|
||||
|
||||
```{brightness: x, opacity: y }```
|
||||
|
||||
- Don't use $.browser.msie, check for getContext on the created canvas element
|
||||
instead and try to use excanvas if it's not found.
|
||||
|
||||
Fixes IE 9 compatibility.
|
||||
|
||||
- highlight(s, index) was looking up the point in the original s.data instead
|
||||
of in the computed datapoints array, which breaks with plugins that modify
|
||||
the datapoints, such as the stacking plugin. (reported by curlypaul924,
|
||||
issue 316)
|
||||
|
||||
- More robust handling of axis from data passed in from getData(). (reported)
|
||||
by Morgan)
|
||||
|
||||
- Fixed problem with turning off bar outline. (fix by Jordi Castells,
|
||||
issue 253)
|
||||
|
||||
- Check the selection passed into setSelection in the selection
|
||||
plugin, to guard against errors when synchronizing plots (fix by Lau
|
||||
Bech Lauritzen).
|
||||
|
||||
- Fix bug in crosshair code with mouseout resetting the crosshair even
|
||||
if it is locked (fix by Lau Bech Lauritzen and Banko Adam).
|
||||
|
||||
- Fix bug with points plotting using line width from lines rather than
|
||||
points.
|
||||
|
||||
- Fix bug with passing non-array 0 data (for plugins that don't expect
|
||||
arrays, patch by vpapp1).
|
||||
|
||||
- Fix errors in JSON in examples so they work with jQuery 1.4.2
|
||||
(fix reported by honestbleeps, issue 357).
|
||||
|
||||
- Fix bug with tooltip in interacting.html, this makes the tooltip
|
||||
much smoother (fix by bdkahn). Fix related bug inside highlighting
|
||||
handler in Flot.
|
||||
|
||||
- Use closure trick to make inline colorhelpers plugin respect
|
||||
jQuery.noConflict(true), renaming the global jQuery object (reported
|
||||
by Nick Stielau).
|
||||
|
||||
- Listen for mouseleave events and fire a plothover event with empty
|
||||
item when it occurs to drop highlights when the mouse leaves the
|
||||
plot (reported by by outspirit).
|
||||
|
||||
- Fix bug with using aboveData with a background (reported by
|
||||
amitayd).
|
||||
|
||||
- Fix possible excanvas leak (report and suggested fix by tom9729).
|
||||
|
||||
- Fix bug with backwards compatibility for shadowSize = 0 (report and
|
||||
suggested fix by aspinak).
|
||||
|
||||
- Adapt examples to skip loading excanvas (fix by Ryley Breiddal).
|
||||
|
||||
- Fix bug that prevent a simple f(x) = -x transform from working
|
||||
correctly (fix by Mike, issue 263).
|
||||
|
||||
- Fix bug in restoring cursor in navigate plugin (reported by Matteo
|
||||
Gattanini, issue 395).
|
||||
|
||||
- Fix bug in picking items when transform/inverseTransform is in use
|
||||
(reported by Ofri Raviv, and patches and analysis by Jan and Tom
|
||||
Paton, issue 334 and 467).
|
||||
|
||||
- Fix problem with unaligned ticks and hover/click events caused by
|
||||
padding on the placeholder by hardcoding the placeholder padding to
|
||||
0 (reported by adityadineshsaxena, Matt Sommer, Daniel Atos and some
|
||||
other people, issue 301).
|
||||
|
||||
- Update colorhelpers plugin to avoid dying when trying to parse an
|
||||
invalid string (reported by cadavor, issue 483).
|
||||
|
||||
|
||||
|
||||
## Flot 0.6 ##
|
||||
|
||||
### API changes ###
|
||||
|
||||
Selection support has been moved to a plugin. Thus if you're passing
|
||||
selection: { mode: something }, you MUST include the file
|
||||
jquery.flot.selection.js after jquery.flot.js. This reduces the size of
|
||||
base Flot and makes it easier to customize the selection as well as
|
||||
improving code clarity. The change is based on a patch from andershol.
|
||||
|
||||
In the global options specified in the $.plot command, "lines", "points",
|
||||
"bars" and "shadowSize" have been moved to a sub-object called "series":
|
||||
|
||||
```js
|
||||
$.plot(placeholder, data, { lines: { show: true }})
|
||||
```
|
||||
|
||||
should be changed to
|
||||
|
||||
```js
|
||||
$.plot(placeholder, data, { series: { lines: { show: true }}})
|
||||
```
|
||||
|
||||
All future series-specific options will go into this sub-object to
|
||||
simplify plugin writing. Backward-compatibility code is in place, so
|
||||
old code should not break.
|
||||
|
||||
"plothover" no longer provides the original data point, but instead a
|
||||
normalized one, since there may be no corresponding original point.
|
||||
|
||||
Due to a bug in previous versions of jQuery, you now need at least
|
||||
jQuery 1.2.6. But if you can, try jQuery 1.3.2 as it got some improvements
|
||||
in event handling speed.
|
||||
|
||||
## Changes ##
|
||||
|
||||
- Added support for disabling interactivity for specific data series.
|
||||
(request from Ronald Schouten and Steve Upton)
|
||||
|
||||
- Flot now calls $() on the placeholder and optional legend container passed
|
||||
in so you can specify DOM elements or CSS expressions to make it easier to
|
||||
use Flot with libraries like Prototype or Mootools or through raw JSON from
|
||||
Ajax responses.
|
||||
|
||||
- A new "plotselecting" event is now emitted while the user is making a
|
||||
selection.
|
||||
|
||||
- The "plothover" event is now emitted immediately instead of at most 10
|
||||
times per second, you'll have to put in a setTimeout yourself if you're
|
||||
doing something really expensive on this event.
|
||||
|
||||
- The built-in date formatter can now be accessed as $.plot.formatDate(...)
|
||||
(suggestion by Matt Manela) and even replaced.
|
||||
|
||||
- Added "borderColor" option to the grid. (patches from Amaury Chamayou and
|
||||
Mike R. Williamson)
|
||||
|
||||
- Added support for gradient backgrounds for the grid. (based on patch from
|
||||
Amaury Chamayou, issue 90)
|
||||
|
||||
The "setting options" example provides a demonstration.
|
||||
|
||||
- Gradient bars. (suggestion by stefpet)
|
||||
|
||||
- Added a "plotunselected" event which is triggered when the selection is
|
||||
removed, see "selection" example. (suggestion by Meda Ugo)
|
||||
|
||||
- The option legend.margin can now specify horizontal and vertical margins
|
||||
independently. (suggestion by someone who's annoyed)
|
||||
|
||||
- Data passed into Flot is now copied to a new canonical format to enable
|
||||
further processing before it hits the drawing routines. As a side-effect,
|
||||
this should make Flot more robust in the face of bad data. (issue 112)
|
||||
|
||||
- Step-wise charting: line charts have a new option "steps" that when set to
|
||||
true connects the points with horizontal/vertical steps instead of diagonal
|
||||
lines.
|
||||
|
||||
- The legend labelFormatter now passes the series in addition to just the
|
||||
label. (suggestion by Vincent Lemeltier)
|
||||
|
||||
- Horizontal bars (based on patch by Jason LeBrun).
|
||||
|
||||
- Support for partial bars by specifying a third coordinate, i.e. they don't
|
||||
have to start from the axis. This can be used to make stacked bars.
|
||||
|
||||
- New option to disable the (grid.show).
|
||||
|
||||
- Added pointOffset method for converting a point in data space to an offset
|
||||
within the placeholder.
|
||||
|
||||
- Plugin system: register an init method in the $.flot.plugins array to get
|
||||
started, see PLUGINS.txt for details on how to write plugins (it's easy).
|
||||
There are also some extra methods to enable access to internal state.
|
||||
|
||||
- Hooks: you can register functions that are called while Flot is crunching
|
||||
the data and doing the plot. This can be used to modify Flot without
|
||||
changing the source, useful for writing plugins. Some hooks are defined,
|
||||
more are likely to come.
|
||||
|
||||
- Threshold plugin: you can set a threshold and a color, and the data points
|
||||
below that threshold will then get the color. Useful for marking data
|
||||
below 0, for instance.
|
||||
|
||||
- Stack plugin: you can specify a stack key for each series to have them
|
||||
summed. This is useful for drawing additive/cumulative graphs with bars and
|
||||
(currently unfilled) lines.
|
||||
|
||||
- Crosshairs plugin: trace the mouse position on the axes, enable with
|
||||
crosshair: { mode: "x"} (see the new tracking example for a use).
|
||||
|
||||
- Image plugin: plot prerendered images.
|
||||
|
||||
- Navigation plugin for panning and zooming a plot.
|
||||
|
||||
- More configurable grid.
|
||||
|
||||
- Axis transformation support, useful for non-linear plots, e.g. log axes and
|
||||
compressed time axes (like omitting weekends).
|
||||
|
||||
- Support for twelve-hour date formatting (patch by Forrest Aldridge).
|
||||
|
||||
- The color parsing code in Flot has been cleaned up and split out so it's
|
||||
now available as a separate jQuery plugin. It's included inline in the Flot
|
||||
source to make dependency managing easier. This also makes it really easy
|
||||
to use the color helpers in Flot plugins.
|
||||
|
||||
## Bug fixes ##
|
||||
|
||||
- Fixed two corner-case bugs when drawing filled curves. (report and analysis
|
||||
by Joshua Varner)
|
||||
|
||||
- Fix auto-adjustment code when setting min to 0 for an axis where the
|
||||
dataset is completely flat on that axis. (report by chovy)
|
||||
|
||||
- Fixed a bug with passing in data from getData to setData when the secondary
|
||||
axes are used. (reported by nperelman, issue 65)
|
||||
|
||||
- Fixed so that it is possible to turn lines off when no other chart type is
|
||||
shown (based on problem reported by Glenn Vanderburg), and fixed so that
|
||||
setting lineWidth to 0 also hides the shadow. (based on problem reported by
|
||||
Sergio Nunes)
|
||||
|
||||
- Updated mousemove position expression to the latest from jQuery. (reported
|
||||
by meyuchas)
|
||||
|
||||
- Use CSS borders instead of background in legend. (issues 25 and 45)
|
||||
|
||||
- Explicitly convert axis min/max to numbers.
|
||||
|
||||
- Fixed a bug with drawing marking lines with different colors. (reported by
|
||||
Khurram)
|
||||
|
||||
- Fixed a bug with returning y2 values in the selection event. (fix by
|
||||
exists, issue 75)
|
||||
|
||||
- Only set position relative on placeholder if it hasn't already a position
|
||||
different from static. (reported by kyberneticist, issue 95)
|
||||
|
||||
- Don't round markings to prevent sub-pixel problems. (reported by
|
||||
Dan Lipsitt)
|
||||
|
||||
- Make the grid border act similarly to a regular CSS border, i.e. prevent
|
||||
it from overlapping the plot itself. This also fixes a problem with anti-
|
||||
aliasing when the width is 1 pixel. (reported by Anthony Ettinger)
|
||||
|
||||
- Imported version 3 of excanvas and fixed two issues with the newer version.
|
||||
Hopefully, this will make Flot work with IE8. (nudge by Fabien Menager,
|
||||
further analysis by Booink, issue 133)
|
||||
|
||||
- Changed the shadow code for lines to hopefully look a bit better with
|
||||
vertical lines.
|
||||
|
||||
- Round tick positions to avoid possible problems with fractions. (suggestion
|
||||
by Fred, issue 130)
|
||||
|
||||
- Made the heuristic for determining how many ticks to aim for a bit smarter.
|
||||
|
||||
- Fix for uneven axis margins (report and patch by Paul Kienzle) and snapping
|
||||
to ticks. (report and patch by lifthrasiir)
|
||||
|
||||
- Fixed bug with slicing in findNearbyItems. (patch by zollman)
|
||||
|
||||
- Make heuristic for x axis label widths more dynamic. (patch by
|
||||
rickinhethuis)
|
||||
|
||||
- Make sure points on top take precedence when finding nearby points when
|
||||
hovering. (reported by didroe, issue 224)
|
||||
|
||||
|
||||
|
||||
## Flot 0.5 ##
|
||||
|
||||
Timestamps are now in UTC. Also "selected" event -> becomes "plotselected"
|
||||
with new data, the parameters for setSelection are now different (but
|
||||
backwards compatibility hooks are in place), coloredAreas becomes markings
|
||||
with a new interface (but backwards compatibility hooks are in place).
|
||||
|
||||
### API changes ###
|
||||
|
||||
Timestamps in time mode are now displayed according to UTC instead of the time
|
||||
zone of the visitor. This affects the way the timestamps should be input;
|
||||
you'll probably have to offset the timestamps according to your local time
|
||||
zone. It also affects any custom date handling code (which basically now
|
||||
should use the equivalent UTC date mehods, e.g. .setUTCMonth() instead of
|
||||
.setMonth().
|
||||
|
||||
Markings, previously coloredAreas, are now specified as ranges on the axes,
|
||||
like ```{ xaxis: { from: 0, to: 10 }}```. Furthermore with markings you can
|
||||
now draw horizontal/vertical lines by setting from and to to the same
|
||||
coordinate. (idea from line support patch by by Ryan Funduk)
|
||||
|
||||
Interactivity: added a new "plothover" event and this and the "plotclick"
|
||||
event now returns the closest data item (based on patch by /david, patch by
|
||||
Mark Byers for bar support). See the revamped "interacting with the data"
|
||||
example for some hints on what you can do.
|
||||
|
||||
Highlighting: you can now highlight points and datapoints are autohighlighted
|
||||
when you hover over them (if hovering is turned on).
|
||||
|
||||
Support for dual axis has been added (based on patch by someone who's annoyed
|
||||
and /david). For each data series you can specify which axes it belongs to,
|
||||
and there are two more axes, x2axis and y2axis, to customize. This affects the
|
||||
"selected" event which has been renamed to "plotselected" and spews out
|
||||
```{ xaxis: { from: -10, to: 20 } ... },``` setSelection in which the
|
||||
parameters are on a new form (backwards compatible hooks are in place so old
|
||||
code shouldn't break) and markings (formerly coloredAreas).
|
||||
|
||||
## Changes ##
|
||||
|
||||
- Added support for specifying the size of tick labels (axis.labelWidth,
|
||||
axis.labelHeight). Useful for specifying a max label size to keep multiple
|
||||
plots aligned.
|
||||
|
||||
- The "fill" option can now be a number that specifies the opacity of the
|
||||
fill.
|
||||
|
||||
- You can now specify a coordinate as null (like [2, null]) and Flot will
|
||||
take the other coordinate into account when scaling the axes. (based on
|
||||
patch by joebno)
|
||||
|
||||
- New option for bars "align". Set it to "center" to center the bars on the
|
||||
value they represent.
|
||||
|
||||
- setSelection now takes a second parameter which you can use to prevent the
|
||||
method from firing the "plotselected" handler.
|
||||
|
||||
- Improved the handling of axis auto-scaling with bars.
|
||||
|
||||
## Bug fixes ##
|
||||
|
||||
- Fixed a bug in calculating spacing around the plot. (reported by
|
||||
timothytoe)
|
||||
|
||||
- Fixed a bug in finding max values for all-negative data sets.
|
||||
|
||||
- Prevent the possibility of eternal looping in tick calculations.
|
||||
|
||||
- Fixed a bug when borderWidth is set to 0. (reported by Rob/sanchothefat)
|
||||
|
||||
- Fixed a bug with drawing bars extending below 0. (reported by James Hewitt,
|
||||
patch by Ryan Funduk).
|
||||
|
||||
- Fixed a bug with line widths of bars. (reported by MikeM)
|
||||
|
||||
- Fixed a bug with 'nw' and 'sw' legend positions.
|
||||
|
||||
- Fixed a bug with multi-line x-axis tick labels. (reported by Luca Ciano,
|
||||
IE-fix help by Savage Zhang)
|
||||
|
||||
- Using the "container" option in legend now overwrites the container element
|
||||
instead of just appending to it, fixing the infinite legend bug. (reported
|
||||
by several people, fix by Brad Dewey)
|
||||
|
||||
|
||||
|
||||
## Flot 0.4 ##
|
||||
|
||||
### API changes ###
|
||||
|
||||
Deprecated axis.noTicks in favor of just specifying the number as axis.ticks.
|
||||
So ```xaxis: { noTicks: 10 }``` becomes ```xaxis: { ticks: 10 }```.
|
||||
|
||||
Time series support. Specify axis.mode: "time", put in Javascript timestamps
|
||||
as data, and Flot will automatically spit out sensible ticks. Take a look at
|
||||
the two new examples. The format can be customized with axis.timeformat and
|
||||
axis.monthNames, or if that fails with axis.tickFormatter.
|
||||
|
||||
Support for colored background areas via grid.coloredAreas. Specify an array
|
||||
of { x1, y1, x2, y2 } objects or a function that returns these given
|
||||
{ xmin, xmax, ymin, ymax }.
|
||||
|
||||
More members on the plot object (report by Chris Davies and others).
|
||||
"getData" for inspecting the assigned settings on data series (e.g. color) and
|
||||
"setData", "setupGrid" and "draw" for updating the contents without a total
|
||||
replot.
|
||||
|
||||
The default number of ticks to aim for is now dependent on the size of the
|
||||
plot in pixels. Support for customizing tick interval sizes directly with
|
||||
axis.minTickSize and axis.tickSize.
|
||||
|
||||
Cleaned up the automatic axis scaling algorithm and fixed how it interacts
|
||||
with ticks. Also fixed a couple of tick-related corner case bugs (one reported
|
||||
by mainstreetmark, another reported by timothytoe).
|
||||
|
||||
The option axis.tickFormatter now takes a function with two parameters, the
|
||||
second parameter is an optional object with information about the axis. It has
|
||||
min, max, tickDecimals, tickSize.
|
||||
|
||||
## Changes ##
|
||||
|
||||
- Added support for segmented lines. (based on patch from Michael MacDonald)
|
||||
|
||||
- Added support for ignoring null and bad values. (suggestion from Nick
|
||||
Konidaris and joshwaihi)
|
||||
|
||||
- Added support for changing the border width. (thanks to joebno and safoo)
|
||||
|
||||
- Label colors can be changed via CSS by selecting the tickLabel class.
|
||||
|
||||
## Bug fixes ##
|
||||
|
||||
- Fixed a bug in handling single-item bar series. (reported by Emil Filipov)
|
||||
|
||||
- Fixed erratic behaviour when interacting with the plot with IE 7. (reported
|
||||
by Lau Bech Lauritzen).
|
||||
|
||||
- Prevent IE/Safari text selection when selecting stuff on the canvas.
|
||||
|
||||
|
||||
|
||||
## Flot 0.3 ##
|
||||
|
||||
This is mostly a quick-fix release because jquery.js wasn't included in the
|
||||
previous zip/tarball.
|
||||
|
||||
## Changes ##
|
||||
|
||||
- Include jquery.js in the zip/tarball.
|
||||
|
||||
- Support clicking on the plot. Turn it on with grid: { clickable: true },
|
||||
then you get a "plotclick" event on the graph placeholder with the position
|
||||
in units of the plot.
|
||||
|
||||
## Bug fixes ##
|
||||
|
||||
- Fixed a bug in dealing with data where min = max. (thanks to Michael
|
||||
Messinides)
|
||||
|
||||
|
||||
|
||||
## Flot 0.2 ##
|
||||
|
||||
The API should now be fully documented.
|
||||
|
||||
### API changes ###
|
||||
|
||||
Moved labelMargin option to grid from x/yaxis.
|
||||
|
||||
## Changes ##
|
||||
|
||||
- Added support for putting a background behind the default legend. The
|
||||
default is the partly transparent background color. Added backgroundColor
|
||||
and backgroundOpacity to the legend options to control this.
|
||||
|
||||
- The ticks options can now be a callback function that takes one parameter,
|
||||
an object with the attributes min and max. The function should return a
|
||||
ticks array.
|
||||
|
||||
- Added labelFormatter option in legend, useful for turning the legend
|
||||
labels into links.
|
||||
|
||||
- Reduced the size of the code. (patch by Guy Fraser)
|
||||
|
||||
|
||||
|
||||
## Flot 0.1 ##
|
||||
|
||||
First public release.
|
|
@ -0,0 +1,143 @@
|
|||
## Writing plugins ##
|
||||
|
||||
All you need to do to make a new plugin is creating an init function
|
||||
and a set of options (if needed), stuffing it into an object and
|
||||
putting it in the $.plot.plugins array. For example:
|
||||
|
||||
```js
|
||||
function myCoolPluginInit(plot) {
|
||||
plot.coolstring = "Hello!";
|
||||
};
|
||||
|
||||
$.plot.plugins.push({ init: myCoolPluginInit, options: { ... } });
|
||||
|
||||
// if $.plot is called, it will return a plot object with the
|
||||
// attribute "coolstring"
|
||||
```
|
||||
|
||||
Now, given that the plugin might run in many different places, it's
|
||||
a good idea to avoid leaking names. The usual trick here is wrap the
|
||||
above lines in an anonymous function which is called immediately, like
|
||||
this: (function () { inner code ... })(). To make it even more robust
|
||||
in case $ is not bound to jQuery but some other Javascript library, we
|
||||
can write it as
|
||||
|
||||
```js
|
||||
(function ($) {
|
||||
// plugin definition
|
||||
// ...
|
||||
})(jQuery);
|
||||
```
|
||||
|
||||
There's a complete example below, but you should also check out the
|
||||
plugins bundled with Flot.
|
||||
|
||||
|
||||
## Complete example ##
|
||||
|
||||
Here is a simple debug plugin which alerts each of the series in the
|
||||
plot. It has a single option that control whether it is enabled and
|
||||
how much info to output:
|
||||
|
||||
```js
|
||||
(function ($) {
|
||||
function init(plot) {
|
||||
var debugLevel = 1;
|
||||
|
||||
function checkDebugEnabled(plot, options) {
|
||||
if (options.debug) {
|
||||
debugLevel = options.debug;
|
||||
plot.hooks.processDatapoints.push(alertSeries);
|
||||
}
|
||||
}
|
||||
|
||||
function alertSeries(plot, series, datapoints) {
|
||||
var msg = "series " + series.label;
|
||||
if (debugLevel > 1) {
|
||||
msg += " with " + series.data.length + " points";
|
||||
alert(msg);
|
||||
}
|
||||
}
|
||||
|
||||
plot.hooks.processOptions.push(checkDebugEnabled);
|
||||
}
|
||||
|
||||
var options = { debug: 0 };
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: "simpledebug",
|
||||
version: "0.1"
|
||||
});
|
||||
})(jQuery);
|
||||
```
|
||||
|
||||
We also define "name" and "version". It's not used by Flot, but might
|
||||
be helpful for other plugins in resolving dependencies.
|
||||
|
||||
Put the above in a file named "jquery.flot.debug.js", include it in an
|
||||
HTML page and then it can be used with:
|
||||
|
||||
```js
|
||||
$.plot($("#placeholder"), [...], { debug: 2 });
|
||||
```
|
||||
|
||||
This simple plugin illustrates a couple of points:
|
||||
|
||||
- It uses the anonymous function trick to avoid name pollution.
|
||||
- It can be enabled/disabled through an option.
|
||||
- Variables in the init function can be used to store plot-specific
|
||||
state between the hooks.
|
||||
|
||||
The two last points are important because there may be multiple plots
|
||||
on the same page, and you'd want to make sure they are not mixed up.
|
||||
|
||||
|
||||
## Shutting down a plugin ##
|
||||
|
||||
Each plot object has a shutdown hook which is run when plot.shutdown()
|
||||
is called. This usually mostly happens in case another plot is made on
|
||||
top of an existing one.
|
||||
|
||||
The purpose of the hook is to give you a chance to unbind any event
|
||||
handlers you've registered and remove any extra DOM things you've
|
||||
inserted.
|
||||
|
||||
The problem with event handlers is that you can have registered a
|
||||
handler which is run in some point in the future, e.g. with
|
||||
setTimeout(). Meanwhile, the plot may have been shutdown and removed,
|
||||
but because your event handler is still referencing it, it can't be
|
||||
garbage collected yet, and worse, if your handler eventually runs, it
|
||||
may overwrite stuff on a completely different plot.
|
||||
|
||||
|
||||
## Some hints on the options ##
|
||||
|
||||
Plugins should always support appropriate options to enable/disable
|
||||
them because the plugin user may have several plots on the same page
|
||||
where only one should use the plugin. In most cases it's probably a
|
||||
good idea if the plugin is turned off rather than on per default, just
|
||||
like most of the powerful features in Flot.
|
||||
|
||||
If the plugin needs options that are specific to each series, like the
|
||||
points or lines options in core Flot, you can put them in "series" in
|
||||
the options object, e.g.
|
||||
|
||||
```js
|
||||
var options = {
|
||||
series: {
|
||||
downsample: {
|
||||
algorithm: null,
|
||||
maxpoints: 1000
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then they will be copied by Flot into each series, providing default
|
||||
values in case none are specified.
|
||||
|
||||
Think hard and long about naming the options. These names are going to
|
||||
be public API, and code is going to depend on them if the plugin is
|
||||
successful.
|
|
@ -0,0 +1,110 @@
|
|||
# Flot [![Build status](https://travis-ci.org/flot/flot.png)](https://travis-ci.org/flot/flot)
|
||||
|
||||
## About ##
|
||||
|
||||
Flot is a Javascript plotting library for jQuery.
|
||||
Read more at the website: <http://www.flotcharts.org/>
|
||||
|
||||
Take a look at the the examples in examples/index.html; they should give a good
|
||||
impression of what Flot can do, and the source code of the examples is probably
|
||||
the fastest way to learn how to use Flot.
|
||||
|
||||
|
||||
## Installation ##
|
||||
|
||||
Just include the Javascript file after you've included jQuery.
|
||||
|
||||
Generally, all browsers that support the HTML5 canvas tag are
|
||||
supported.
|
||||
|
||||
For support for Internet Explorer < 9, you can use [Excanvas]
|
||||
[excanvas], a canvas emulator; this is used in the examples bundled
|
||||
with Flot. You just include the excanvas script like this:
|
||||
|
||||
```html
|
||||
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="excanvas.min.js"></script><![endif]-->
|
||||
```
|
||||
|
||||
If it's not working on your development IE 6.0, check that it has
|
||||
support for VML which Excanvas is relying on. It appears that some
|
||||
stripped down versions used for test environments on virtual machines
|
||||
lack the VML support.
|
||||
|
||||
You can also try using [Flashcanvas][flashcanvas], which uses Flash to
|
||||
do the emulation. Although Flash can be a bit slower to load than VML,
|
||||
if you've got a lot of points, the Flash version can be much faster
|
||||
overall. Flot contains some wrapper code for activating Excanvas which
|
||||
Flashcanvas is compatible with.
|
||||
|
||||
You need at least jQuery 1.2.6, but try at least 1.3.2 for interactive
|
||||
charts because of performance improvements in event handling.
|
||||
|
||||
|
||||
## Basic usage ##
|
||||
|
||||
Create a placeholder div to put the graph in:
|
||||
|
||||
```html
|
||||
<div id="placeholder"></div>
|
||||
```
|
||||
|
||||
You need to set the width and height of this div, otherwise the plot
|
||||
library doesn't know how to scale the graph. You can do it inline like
|
||||
this:
|
||||
|
||||
```html
|
||||
<div id="placeholder" style="width:600px;height:300px"></div>
|
||||
```
|
||||
|
||||
You can also do it with an external stylesheet. Make sure that the
|
||||
placeholder isn't within something with a display:none CSS property -
|
||||
in that case, Flot has trouble measuring label dimensions which
|
||||
results in garbled looks and might have trouble measuring the
|
||||
placeholder dimensions which is fatal (it'll throw an exception).
|
||||
|
||||
Then when the div is ready in the DOM, which is usually on document
|
||||
ready, run the plot function:
|
||||
|
||||
```js
|
||||
$.plot($("#placeholder"), data, options);
|
||||
```
|
||||
|
||||
Here, data is an array of data series and options is an object with
|
||||
settings if you want to customize the plot. Take a look at the
|
||||
examples for some ideas of what to put in or look at the
|
||||
[API reference](API.md). Here's a quick example that'll draw a line
|
||||
from (0, 0) to (1, 1):
|
||||
|
||||
```js
|
||||
$.plot($("#placeholder"), [ [[0, 0], [1, 1]] ], { yaxis: { max: 1 } });
|
||||
```
|
||||
|
||||
The plot function immediately draws the chart and then returns a plot
|
||||
object with a couple of methods.
|
||||
|
||||
|
||||
## What's with the name? ##
|
||||
|
||||
First: it's pronounced with a short o, like "plot". Not like "flawed".
|
||||
|
||||
So "Flot" rhymes with "plot".
|
||||
|
||||
And if you look up "flot" in a Danish-to-English dictionary, some of
|
||||
the words that come up are "good-looking", "attractive", "stylish",
|
||||
"smart", "impressive", "extravagant". One of the main goals with Flot
|
||||
is pretty looks.
|
||||
|
||||
|
||||
## Notes about the examples ##
|
||||
|
||||
In order to have a useful, functional example of time-series plots using time
|
||||
zones, date.js from [timezone-js][timezone-js] (released under the Apache 2.0
|
||||
license) and the [Olson][olson] time zone database (released to the public
|
||||
domain) have been included in the examples directory. They are used in
|
||||
examples/axes-time-zones/index.html.
|
||||
|
||||
|
||||
[excanvas]: http://code.google.com/p/explorercanvas/
|
||||
[flashcanvas]: http://code.google.com/p/flashcanvas/
|
||||
[timezone-js]: https://github.com/mde/timezone-js
|
||||
[olson]: ftp://ftp.iana.org/tz/
|
|
@ -0,0 +1,179 @@
|
|||
/* Plugin for jQuery for working with colors.
|
||||
*
|
||||
* Version 1.1.
|
||||
*
|
||||
* Inspiration from jQuery color animation plugin by John Resig.
|
||||
*
|
||||
* Released under the MIT license by Ole Laursen, October 2009.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* $.color.parse("#fff").scale('rgb', 0.25).add('a', -0.5).toString()
|
||||
* var c = $.color.extract($("#mydiv"), 'background-color');
|
||||
* console.log(c.r, c.g, c.b, c.a);
|
||||
* $.color.make(100, 50, 25, 0.4).toString() // returns "rgba(100,50,25,0.4)"
|
||||
*
|
||||
* Note that .scale() and .add() return the same modified object
|
||||
* instead of making a new one.
|
||||
*
|
||||
* V. 1.1: Fix error handling so e.g. parsing an empty string does
|
||||
* produce a color rather than just crashing.
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
$.color = {};
|
||||
|
||||
// construct color object with some convenient chainable helpers
|
||||
$.color.make = function (r, g, b, a) {
|
||||
var o = {};
|
||||
o.r = r || 0;
|
||||
o.g = g || 0;
|
||||
o.b = b || 0;
|
||||
o.a = a != null ? a : 1;
|
||||
|
||||
o.add = function (c, d) {
|
||||
for (var i = 0; i < c.length; ++i)
|
||||
o[c.charAt(i)] += d;
|
||||
return o.normalize();
|
||||
};
|
||||
|
||||
o.scale = function (c, f) {
|
||||
for (var i = 0; i < c.length; ++i)
|
||||
o[c.charAt(i)] *= f;
|
||||
return o.normalize();
|
||||
};
|
||||
|
||||
o.toString = function () {
|
||||
if (o.a >= 1.0) {
|
||||
return "rgb("+[o.r, o.g, o.b].join(",")+")";
|
||||
} else {
|
||||
return "rgba("+[o.r, o.g, o.b, o.a].join(",")+")";
|
||||
}
|
||||
};
|
||||
|
||||
o.normalize = function () {
|
||||
function clamp(min, value, max) {
|
||||
return value < min ? min: (value > max ? max: value);
|
||||
}
|
||||
|
||||
o.r = clamp(0, parseInt(o.r), 255);
|
||||
o.g = clamp(0, parseInt(o.g), 255);
|
||||
o.b = clamp(0, parseInt(o.b), 255);
|
||||
o.a = clamp(0, o.a, 1);
|
||||
return o;
|
||||
};
|
||||
|
||||
o.clone = function () {
|
||||
return $.color.make(o.r, o.b, o.g, o.a);
|
||||
};
|
||||
|
||||
return o.normalize();
|
||||
}
|
||||
|
||||
// extract CSS color property from element, going up in the DOM
|
||||
// if it's "transparent"
|
||||
$.color.extract = function (elem, css) {
|
||||
var c;
|
||||
do {
|
||||
c = elem.css(css).toLowerCase();
|
||||
// keep going until we find an element that has color, or
|
||||
// we hit the body
|
||||
if (c != '' && c != 'transparent')
|
||||
break;
|
||||
elem = elem.parent();
|
||||
} while (!$.nodeName(elem.get(0), "body"));
|
||||
|
||||
// catch Safari's way of signalling transparent
|
||||
if (c == "rgba(0, 0, 0, 0)")
|
||||
c = "transparent";
|
||||
|
||||
return $.color.parse(c);
|
||||
}
|
||||
|
||||
// parse CSS color string (like "rgb(10, 32, 43)" or "#fff"),
|
||||
// returns color object, if parsing failed, you get black (0, 0,
|
||||
// 0) out
|
||||
$.color.parse = function (str) {
|
||||
var res, m = $.color.make;
|
||||
|
||||
// Look for rgb(num,num,num)
|
||||
if (res = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str))
|
||||
return m(parseInt(res[1], 10), parseInt(res[2], 10), parseInt(res[3], 10));
|
||||
|
||||
// Look for rgba(num,num,num,num)
|
||||
if (res = /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))
|
||||
return m(parseInt(res[1], 10), parseInt(res[2], 10), parseInt(res[3], 10), parseFloat(res[4]));
|
||||
|
||||
// Look for rgb(num%,num%,num%)
|
||||
if (res = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(str))
|
||||
return m(parseFloat(res[1])*2.55, parseFloat(res[2])*2.55, parseFloat(res[3])*2.55);
|
||||
|
||||
// Look for rgba(num%,num%,num%,num)
|
||||
if (res = /rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))
|
||||
return m(parseFloat(res[1])*2.55, parseFloat(res[2])*2.55, parseFloat(res[3])*2.55, parseFloat(res[4]));
|
||||
|
||||
// Look for #a0b1c2
|
||||
if (res = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))
|
||||
return m(parseInt(res[1], 16), parseInt(res[2], 16), parseInt(res[3], 16));
|
||||
|
||||
// Look for #fff
|
||||
if (res = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str))
|
||||
return m(parseInt(res[1]+res[1], 16), parseInt(res[2]+res[2], 16), parseInt(res[3]+res[3], 16));
|
||||
|
||||
// Otherwise, we're most likely dealing with a named color
|
||||
var name = $.trim(str).toLowerCase();
|
||||
if (name == "transparent")
|
||||
return m(255, 255, 255, 0);
|
||||
else {
|
||||
// default to black
|
||||
res = lookupColors[name] || [0, 0, 0];
|
||||
return m(res[0], res[1], res[2]);
|
||||
}
|
||||
}
|
||||
|
||||
var lookupColors = {
|
||||
aqua:[0,255,255],
|
||||
azure:[240,255,255],
|
||||
beige:[245,245,220],
|
||||
black:[0,0,0],
|
||||
blue:[0,0,255],
|
||||
brown:[165,42,42],
|
||||
cyan:[0,255,255],
|
||||
darkblue:[0,0,139],
|
||||
darkcyan:[0,139,139],
|
||||
darkgrey:[169,169,169],
|
||||
darkgreen:[0,100,0],
|
||||
darkkhaki:[189,183,107],
|
||||
darkmagenta:[139,0,139],
|
||||
darkolivegreen:[85,107,47],
|
||||
darkorange:[255,140,0],
|
||||
darkorchid:[153,50,204],
|
||||
darkred:[139,0,0],
|
||||
darksalmon:[233,150,122],
|
||||
darkviolet:[148,0,211],
|
||||
fuchsia:[255,0,255],
|
||||
gold:[255,215,0],
|
||||
green:[0,128,0],
|
||||
indigo:[75,0,130],
|
||||
khaki:[240,230,140],
|
||||
lightblue:[173,216,230],
|
||||
lightcyan:[224,255,255],
|
||||
lightgreen:[144,238,144],
|
||||
lightgrey:[211,211,211],
|
||||
lightpink:[255,182,193],
|
||||
lightyellow:[255,255,224],
|
||||
lime:[0,255,0],
|
||||
magenta:[255,0,255],
|
||||
maroon:[128,0,0],
|
||||
navy:[0,0,128],
|
||||
olive:[128,128,0],
|
||||
orange:[255,165,0],
|
||||
pink:[255,192,203],
|
||||
purple:[128,0,128],
|
||||
violet:[128,0,128],
|
||||
red:[255,0,0],
|
||||
silver:[192,192,192],
|
||||
white:[255,255,255],
|
||||
yellow:[255,255,0]
|
||||
};
|
||||
})(jQuery);
|
|
@ -0,0 +1,21 @@
|
|||
/* Plugin for jQuery for working with colors.
|
||||
*
|
||||
* Version 1.1.
|
||||
*
|
||||
* Inspiration from jQuery color animation plugin by John Resig.
|
||||
*
|
||||
* Released under the MIT license by Ole Laursen, October 2009.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* $.color.parse("#fff").scale('rgb', 0.25).add('a', -0.5).toString()
|
||||
* var c = $.color.extract($("#mydiv"), 'background-color');
|
||||
* console.log(c.r, c.g, c.b, c.a);
|
||||
* $.color.make(100, 50, 25, 0.4).toString() // returns "rgba(100,50,25,0.4)"
|
||||
*
|
||||
* Note that .scale() and .add() return the same modified object
|
||||
* instead of making a new one.
|
||||
*
|
||||
* V. 1.1: Fix error handling so e.g. parsing an empty string does
|
||||
* produce a color rather than just crashing.
|
||||
*/(function(e){e.color={},e.color.make=function(t,n,r,i){var s={};return s.r=t||0,s.g=n||0,s.b=r||0,s.a=i!=null?i:1,s.add=function(e,t){for(var n=0;n<e.length;++n)s[e.charAt(n)]+=t;return s.normalize()},s.scale=function(e,t){for(var n=0;n<e.length;++n)s[e.charAt(n)]*=t;return s.normalize()},s.toString=function(){return s.a>=1?"rgb("+[s.r,s.g,s.b].join(",")+")":"rgba("+[s.r,s.g,s.b,s.a].join(",")+")"},s.normalize=function(){function e(e,t,n){return t<e?e:t>n?n:t}return s.r=e(0,parseInt(s.r),255),s.g=e(0,parseInt(s.g),255),s.b=e(0,parseInt(s.b),255),s.a=e(0,s.a,1),s},s.clone=function(){return e.color.make(s.r,s.b,s.g,s.a)},s.normalize()},e.color.extract=function(t,n){var r;do{r=t.css(n).toLowerCase();if(r!=""&&r!="transparent")break;t=t.parent()}while(!e.nodeName(t.get(0),"body"));return r=="rgba(0, 0, 0, 0)"&&(r="transparent"),e.color.parse(r)},e.color.parse=function(n){var r,i=e.color.make;if(r=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(n))return i(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10));if(r=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(n))return i(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),parseFloat(r[4]));if(r=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(n))return i(parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55);if(r=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(n))return i(parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55,parseFloat(r[4]));if(r=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(n))return i(parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16));if(r=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(n))return i(parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16));var s=e.trim(n).toLowerCase();return s=="transparent"?i(255,255,255,0):(r=t[s]||[0,0,0],i(r[0],r[1],r[2]))};var t={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);
|
|
@ -0,0 +1,131 @@
|
|||
/* jQuery Flot Animator version 1.0.
|
||||
|
||||
Flot Animator is a free jQuery Plugin that will add fluid animations to Flot charts.
|
||||
|
||||
Copyright (c) 2012-2013 Chtiwi Malek
|
||||
http://www.codicode.com/art/jquery_flot_animator.aspx
|
||||
|
||||
Licensed under Creative Commons Attribution 3.0 Unported License.
|
||||
*/
|
||||
|
||||
$.extend({
|
||||
plotAnimator: function (chart, data,g){
|
||||
|
||||
var serie = 0;
|
||||
for (var i = 0; i < data.length; i++)
|
||||
{
|
||||
if (data[i].animator)
|
||||
{
|
||||
serie = i;
|
||||
}
|
||||
}
|
||||
|
||||
function pInit(arr){
|
||||
var x = [];
|
||||
x.push([arr[0][0], Math.max.apply(Math, arr.map(function(i) { return i[1];}))]);
|
||||
x.push([arr[0][0], null]);
|
||||
x.push([arr[0][0], Math.min.apply(Math, arr.map(function(i) { return i[1];}))]);
|
||||
for(var i = 0; i < arr.length; i++) {
|
||||
x.push([arr[i][0], null]);
|
||||
}
|
||||
data[serie].data = x;
|
||||
return $.plot(chart, data, g);
|
||||
}
|
||||
|
||||
var d0 = data[serie];
|
||||
var oData = d0.data;
|
||||
|
||||
var plot = pInit(oData);
|
||||
|
||||
var isLines = (data[serie].lines)?true:false;
|
||||
var steps = (data[serie].animator && data[serie].animator.steps) || 135;
|
||||
var duration = (data[serie].animator && data[serie].animator.duration) || 1000;
|
||||
var start = (data[serie].animator && data[serie].animator.start) || 0;
|
||||
var dir = (data[serie].animator && data[serie].animator.direction) || "right";
|
||||
function stepData()
|
||||
{
|
||||
var Si = oData[0][0];
|
||||
var Fi = oData[oData.length-1][0];
|
||||
var Pas = (Fi-Si)/steps;
|
||||
|
||||
var d2 = [];
|
||||
d2.push(oData[0]);
|
||||
var nPointPos = 1;
|
||||
lPoint = oData[0];
|
||||
nPoint = oData[nPointPos];
|
||||
for (var i = Si+Pas; i < Fi+Pas; i += Pas)
|
||||
{
|
||||
if (i>Fi) {i=Fi;}
|
||||
$("#m2").html(i);
|
||||
while (i > nPoint[0])
|
||||
{
|
||||
lPoint = nPoint;
|
||||
nPoint = oData[nPointPos++];
|
||||
}
|
||||
if (i == nPoint[0])
|
||||
{
|
||||
d2.push([i,nPoint[1]]);
|
||||
lPoint = nPoint;
|
||||
nPoint = oData[nPointPos++];
|
||||
}
|
||||
else
|
||||
{
|
||||
var a = ((nPoint[1]-lPoint[1]) / ((nPoint[0]-lPoint[0])));
|
||||
curV = (a * i) + (lPoint[1] - (a * lPoint[0]));
|
||||
d2.push([i,curV]);
|
||||
}
|
||||
}
|
||||
return d2;
|
||||
}
|
||||
|
||||
var step=0;
|
||||
var sData = stepData();
|
||||
function plotData()
|
||||
{
|
||||
var d3=[];
|
||||
step++;
|
||||
|
||||
switch(dir)
|
||||
{
|
||||
case 'right':
|
||||
d3 = sData.slice(0, step);
|
||||
break;
|
||||
case 'left':
|
||||
d3 = sData.slice(-1*step);
|
||||
break
|
||||
case 'center':
|
||||
d3 = sData.slice((sData.length/2)-(step/2),(sData.length/2)+(step/2));
|
||||
break;
|
||||
}
|
||||
|
||||
if (!isLines)
|
||||
{
|
||||
inV = d3[0][0];
|
||||
laV = d3[d3.length-1][0];
|
||||
d3=[];
|
||||
for (var i = 0; i < oData.length; i++)
|
||||
{
|
||||
if (oData[i][0]>=inV && oData[i][0]<=laV)
|
||||
{
|
||||
d3.push(oData[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data[serie].data = (step<steps)?d3:oData;
|
||||
plot.setData(data);
|
||||
plot.draw();
|
||||
if (step<steps)
|
||||
{
|
||||
setTimeout(plotData, duration/steps);
|
||||
}
|
||||
else
|
||||
{
|
||||
chart.trigger( "animatorComplete" );
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout(plotData,start);
|
||||
return plot;
|
||||
}
|
||||
});
|
|
@ -0,0 +1,11 @@
|
|||
/* jQuery Flot Animator version 1.0.
|
||||
|
||||
Flot Animator is a free jQuery Plugin that will add fluid animations to Flot charts.
|
||||
|
||||
Copyright (c) 2012-2013 Chtiwi Malek
|
||||
http://www.codicode.com/art/jquery_flot_animator.aspx
|
||||
|
||||
Licensed under Creative Commons Attribution 3.0 Unported License.
|
||||
*/
|
||||
|
||||
eval(function(p,a,c,k,e,d){while(c--)if(k[c])p=p.replace(new RegExp('\\b'+c.toString(a)+'\\b','g'),k[c]);return p;}('$.1m({1w:b(e,t,n){b h(){3 e=o[0][0];3 t=o[o.8-1][0];3 n=(t-e)/a;3 r=[];r.6(o[0]);3 i=1;7=o[0];4=o[i];q(3 s=e+n;s<t+n;s+=n){9(s>t){s=t}$("#18").19(s);1a(s>4[0]){7=4;4=o[i++]}9(s==4[0]){r.6([s,4[1]]);7=4;4=o[i++]}11{3 u=(4[1]-7[1])/(4[0]-7[0]);16=u*s+(7[1]-u*7[0]);r.6([s,16])}}j r}b v(){3 n=[];p++;1b(c){14"1c":n=d.w(-1*p);y;14"1h":n=d.w(d.8/2-p/2,d.8/2+p/2);y;1d:n=d.w(0,p);y}9(!u){13=n[0][0];12=n[n.8-1][0];n=[];q(3 i=0;i<o.8;i++){9(o[i][0]>=13&&o[i][0]<=12){n.6(o[i])}}}t[r].x=p<a?n:o;g.1j(t);g.1i();9(p<a){15(v,f/a)}11{e.1g("1f")}}b m(i){3 s=[];s.6([i[0][0],k.1e.10(k,i.z(b(e){j e[1]}))]);s.6([i[0][0],17]);s.6([i[0][0],k.1k.10(k,i.z(b(e){j e[1]}))]);q(3 o=0;o<i.8;o++){s.6([i[o][0],17])}t[r].x=s;j $.1l(e,t,n)}3 r=0;q(3 i=0;i<t.8;i++){9(t[i].5){r=i}}3 s=t[r];3 o=s.x;3 u=t[r].1v?1x:1t;3 a=t[r].5&&t[r].5.1r||1q;3 f=t[r].5&&t[r].5.1p||1o;3 l=t[r].5&&t[r].5.1n||0;3 c=t[r].5&&t[r].5.1u||"1s";3 p=0;3 d=h();3 g=m(o);15(v,l);j g}})',36,70,'|||var|nPoint|animator|push|lPoint|length|if||function||||||||return|Math||||||for||||||slice|data|break|map|apply|else|laV|inV|case|setTimeout|curV|null|m2|html|while|switch|left|default|max|animatorComplete|trigger|center|draw|setData|min|plot|extend|start|1e3|duration|135|steps|right|false|direction|lines|plotAnimator|true'.split('|')))
|
|
@ -0,0 +1,345 @@
|
|||
/* Flot plugin for drawing all elements of a plot on the canvas.
|
||||
|
||||
Copyright (c) 2007-2013 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
Flot normally produces certain elements, like axis labels and the legend, using
|
||||
HTML elements. This permits greater interactivity and customization, and often
|
||||
looks better, due to cross-browser canvas text inconsistencies and limitations.
|
||||
|
||||
It can also be desirable to render the plot entirely in canvas, particularly
|
||||
if the goal is to save it as an image, or if Flot is being used in a context
|
||||
where the HTML DOM does not exist, as is the case within Node.js. This plugin
|
||||
switches out Flot's standard drawing operations for canvas-only replacements.
|
||||
|
||||
Currently the plugin supports only axis labels, but it will eventually allow
|
||||
every element of the plot to be rendered directly to canvas.
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
{
|
||||
canvas: boolean
|
||||
}
|
||||
|
||||
The "canvas" option controls whether full canvas drawing is enabled, making it
|
||||
possible to toggle on and off. This is useful when a plot uses HTML text in the
|
||||
browser, but needs to redraw with canvas text when exporting as an image.
|
||||
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
var options = {
|
||||
canvas: true
|
||||
};
|
||||
|
||||
var render, getTextInfo, addText;
|
||||
|
||||
// Cache the prototype hasOwnProperty for faster access
|
||||
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
function init(plot, classes) {
|
||||
|
||||
var Canvas = classes.Canvas;
|
||||
|
||||
// We only want to replace the functions once; the second time around
|
||||
// we would just get our new function back. This whole replacing of
|
||||
// prototype functions is a disaster, and needs to be changed ASAP.
|
||||
|
||||
if (render == null) {
|
||||
getTextInfo = Canvas.prototype.getTextInfo,
|
||||
addText = Canvas.prototype.addText,
|
||||
render = Canvas.prototype.render;
|
||||
}
|
||||
|
||||
// Finishes rendering the canvas, including overlaid text
|
||||
|
||||
Canvas.prototype.render = function() {
|
||||
|
||||
if (!plot.getOptions().canvas) {
|
||||
return render.call(this);
|
||||
}
|
||||
|
||||
var context = this.context,
|
||||
cache = this._textCache;
|
||||
|
||||
// For each text layer, render elements marked as active
|
||||
|
||||
context.save();
|
||||
context.textBaseline = "middle";
|
||||
|
||||
for (var layerKey in cache) {
|
||||
if (hasOwnProperty.call(cache, layerKey)) {
|
||||
var layerCache = cache[layerKey];
|
||||
for (var styleKey in layerCache) {
|
||||
if (hasOwnProperty.call(layerCache, styleKey)) {
|
||||
var styleCache = layerCache[styleKey],
|
||||
updateStyles = true;
|
||||
for (var key in styleCache) {
|
||||
if (hasOwnProperty.call(styleCache, key)) {
|
||||
|
||||
var info = styleCache[key],
|
||||
positions = info.positions,
|
||||
lines = info.lines;
|
||||
|
||||
// Since every element at this level of the cache have the
|
||||
// same font and fill styles, we can just change them once
|
||||
// using the values from the first element.
|
||||
|
||||
if (updateStyles) {
|
||||
context.fillStyle = info.font.color;
|
||||
context.font = info.font.definition;
|
||||
updateStyles = false;
|
||||
}
|
||||
|
||||
for (var i = 0, position; position = positions[i]; i++) {
|
||||
if (position.active) {
|
||||
for (var j = 0, line; line = position.lines[j]; j++) {
|
||||
context.fillText(lines[j].text, line[0], line[1]);
|
||||
}
|
||||
} else {
|
||||
positions.splice(i--, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (positions.length == 0) {
|
||||
delete styleCache[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
context.restore();
|
||||
};
|
||||
|
||||
// Creates (if necessary) and returns a text info object.
|
||||
//
|
||||
// When the canvas option is set, the object looks like this:
|
||||
//
|
||||
// {
|
||||
// width: Width of the text's bounding box.
|
||||
// height: Height of the text's bounding box.
|
||||
// positions: Array of positions at which this text is drawn.
|
||||
// lines: [{
|
||||
// height: Height of this line.
|
||||
// widths: Width of this line.
|
||||
// text: Text on this line.
|
||||
// }],
|
||||
// font: {
|
||||
// definition: Canvas font property string.
|
||||
// color: Color of the text.
|
||||
// },
|
||||
// }
|
||||
//
|
||||
// The positions array contains objects that look like this:
|
||||
//
|
||||
// {
|
||||
// active: Flag indicating whether the text should be visible.
|
||||
// lines: Array of [x, y] coordinates at which to draw the line.
|
||||
// x: X coordinate at which to draw the text.
|
||||
// y: Y coordinate at which to draw the text.
|
||||
// }
|
||||
|
||||
Canvas.prototype.getTextInfo = function(layer, text, font, angle, width) {
|
||||
|
||||
if (!plot.getOptions().canvas) {
|
||||
return getTextInfo.call(this, layer, text, font, angle, width);
|
||||
}
|
||||
|
||||
var textStyle, layerCache, styleCache, info;
|
||||
|
||||
// Cast the value to a string, in case we were given a number
|
||||
|
||||
text = "" + text;
|
||||
|
||||
// If the font is a font-spec object, generate a CSS definition
|
||||
|
||||
if (typeof font === "object") {
|
||||
textStyle = font.style + " " + font.variant + " " + font.weight + " " + font.size + "px " + font.family;
|
||||
} else {
|
||||
textStyle = font;
|
||||
}
|
||||
|
||||
// Retrieve (or create) the cache for the text's layer and styles
|
||||
|
||||
layerCache = this._textCache[layer];
|
||||
|
||||
if (layerCache == null) {
|
||||
layerCache = this._textCache[layer] = {};
|
||||
}
|
||||
|
||||
styleCache = layerCache[textStyle];
|
||||
|
||||
if (styleCache == null) {
|
||||
styleCache = layerCache[textStyle] = {};
|
||||
}
|
||||
|
||||
info = styleCache[text];
|
||||
|
||||
if (info == null) {
|
||||
|
||||
var context = this.context;
|
||||
|
||||
// If the font was provided as CSS, create a div with those
|
||||
// classes and examine it to generate a canvas font spec.
|
||||
|
||||
if (typeof font !== "object") {
|
||||
|
||||
var element = $("<div> </div>")
|
||||
.css("position", "absolute")
|
||||
.addClass(typeof font === "string" ? font : null)
|
||||
.appendTo(this.getTextLayer(layer));
|
||||
|
||||
font = {
|
||||
lineHeight: element.height(),
|
||||
style: element.css("font-style"),
|
||||
variant: element.css("font-variant"),
|
||||
weight: element.css("font-weight"),
|
||||
family: element.css("font-family"),
|
||||
color: element.css("color")
|
||||
};
|
||||
|
||||
// Setting line-height to 1, without units, sets it equal
|
||||
// to the font-size, even if the font-size is abstract,
|
||||
// like 'smaller'. This enables us to read the real size
|
||||
// via the element's height, working around browsers that
|
||||
// return the literal 'smaller' value.
|
||||
|
||||
font.size = element.css("line-height", 1).height();
|
||||
|
||||
element.remove();
|
||||
}
|
||||
|
||||
textStyle = font.style + " " + font.variant + " " + font.weight + " " + font.size + "px " + font.family;
|
||||
|
||||
// Create a new info object, initializing the dimensions to
|
||||
// zero so we can count them up line-by-line.
|
||||
|
||||
info = styleCache[text] = {
|
||||
width: 0,
|
||||
height: 0,
|
||||
positions: [],
|
||||
lines: [],
|
||||
font: {
|
||||
definition: textStyle,
|
||||
color: font.color
|
||||
}
|
||||
};
|
||||
|
||||
context.save();
|
||||
context.font = textStyle;
|
||||
|
||||
// Canvas can't handle multi-line strings; break on various
|
||||
// newlines, including HTML brs, to build a list of lines.
|
||||
// Note that we could split directly on regexps, but IE < 9 is
|
||||
// broken; revisit when we drop IE 7/8 support.
|
||||
|
||||
var lines = (text + "").replace(/<br ?\/?>|\r\n|\r/g, "\n").split("\n");
|
||||
|
||||
for (var i = 0; i < lines.length; ++i) {
|
||||
|
||||
var lineText = lines[i],
|
||||
measured = context.measureText(lineText);
|
||||
|
||||
info.width = Math.max(measured.width, info.width);
|
||||
info.height += font.lineHeight;
|
||||
|
||||
info.lines.push({
|
||||
text: lineText,
|
||||
width: measured.width,
|
||||
height: font.lineHeight
|
||||
});
|
||||
}
|
||||
|
||||
context.restore();
|
||||
}
|
||||
|
||||
return info;
|
||||
};
|
||||
|
||||
// Adds a text string to the canvas text overlay.
|
||||
|
||||
Canvas.prototype.addText = function(layer, x, y, text, font, angle, width, halign, valign) {
|
||||
|
||||
if (!plot.getOptions().canvas) {
|
||||
return addText.call(this, layer, x, y, text, font, angle, width, halign, valign);
|
||||
}
|
||||
|
||||
var info = this.getTextInfo(layer, text, font, angle, width),
|
||||
positions = info.positions,
|
||||
lines = info.lines;
|
||||
|
||||
// Text is drawn with baseline 'middle', which we need to account
|
||||
// for by adding half a line's height to the y position.
|
||||
|
||||
y += info.height / lines.length / 2;
|
||||
|
||||
// Tweak the initial y-position to match vertical alignment
|
||||
|
||||
if (valign == "middle") {
|
||||
y = Math.round(y - info.height / 2);
|
||||
} else if (valign == "bottom") {
|
||||
y = Math.round(y - info.height);
|
||||
} else {
|
||||
y = Math.round(y);
|
||||
}
|
||||
|
||||
// FIXME: LEGACY BROWSER FIX
|
||||
// AFFECTS: Opera < 12.00
|
||||
|
||||
// Offset the y coordinate, since Opera is off pretty
|
||||
// consistently compared to the other browsers.
|
||||
|
||||
if (!!(window.opera && window.opera.version().split(".")[0] < 12)) {
|
||||
y -= 2;
|
||||
}
|
||||
|
||||
// Determine whether this text already exists at this position.
|
||||
// If so, mark it for inclusion in the next render pass.
|
||||
|
||||
for (var i = 0, position; position = positions[i]; i++) {
|
||||
if (position.x == x && position.y == y) {
|
||||
position.active = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// If the text doesn't exist at this position, create a new entry
|
||||
|
||||
position = {
|
||||
active: true,
|
||||
lines: [],
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
|
||||
positions.push(position);
|
||||
|
||||
// Fill in the x & y positions of each line, adjusting them
|
||||
// individually for horizontal alignment.
|
||||
|
||||
for (var i = 0, line; line = lines[i]; i++) {
|
||||
if (halign == "center") {
|
||||
position.lines.push([Math.round(x - line.width / 2), y]);
|
||||
} else if (halign == "right") {
|
||||
position.lines.push([Math.round(x - line.width), y]);
|
||||
} else {
|
||||
position.lines.push([Math.round(x), y]);
|
||||
}
|
||||
y += line.height;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: "canvas",
|
||||
version: "1.0"
|
||||
});
|
||||
|
||||
})(jQuery);
|
|
@ -0,0 +1,28 @@
|
|||
/* Flot plugin for drawing all elements of a plot on the canvas.
|
||||
|
||||
Copyright (c) 2007-2013 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
Flot normally produces certain elements, like axis labels and the legend, using
|
||||
HTML elements. This permits greater interactivity and customization, and often
|
||||
looks better, due to cross-browser canvas text inconsistencies and limitations.
|
||||
|
||||
It can also be desirable to render the plot entirely in canvas, particularly
|
||||
if the goal is to save it as an image, or if Flot is being used in a context
|
||||
where the HTML DOM does not exist, as is the case within Node.js. This plugin
|
||||
switches out Flot's standard drawing operations for canvas-only replacements.
|
||||
|
||||
Currently the plugin supports only axis labels, but it will eventually allow
|
||||
every element of the plot to be rendered directly to canvas.
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
{
|
||||
canvas: boolean
|
||||
}
|
||||
|
||||
The "canvas" option controls whether full canvas drawing is enabled, making it
|
||||
possible to toggle on and off. This is useful when a plot uses HTML text in the
|
||||
browser, but needs to redraw with canvas text when exporting as an image.
|
||||
|
||||
*/(function(e){function o(t,o){var u=o.Canvas;n==null&&(r=u.prototype.getTextInfo,i=u.prototype.addText,n=u.prototype.render),u.prototype.render=function(){if(!t.getOptions().canvas)return n.call(this);var e=this.context,r=this._textCache;e.save(),e.textBaseline="middle";for(var i in r)if(s.call(r,i)){var o=r[i];for(var u in o)if(s.call(o,u)){var a=o[u],f=!0;for(var l in a)if(s.call(a,l)){var c=a[l],h=c.positions,p=c.lines;f&&(e.fillStyle=c.font.color,e.font=c.font.definition,f=!1);for(var d=0,v;v=h[d];d++)if(v.active)for(var m=0,g;g=v.lines[m];m++)e.fillText(p[m].text,g[0],g[1]);else h.splice(d--,1);h.length==0&&delete a[l]}}}e.restore()},u.prototype.getTextInfo=function(n,i,s,o,u){if(!t.getOptions().canvas)return r.call(this,n,i,s,o,u);var a,f,l,c;i=""+i,typeof s=="object"?a=s.style+" "+s.variant+" "+s.weight+" "+s.size+"px "+s.family:a=s,f=this._textCache[n],f==null&&(f=this._textCache[n]={}),l=f[a],l==null&&(l=f[a]={}),c=l[i];if(c==null){var h=this.context;if(typeof s!="object"){var p=e("<div> </div>").css("position","absolute").addClass(typeof s=="string"?s:null).appendTo(this.getTextLayer(n));s={lineHeight:p.height(),style:p.css("font-style"),variant:p.css("font-variant"),weight:p.css("font-weight"),family:p.css("font-family"),color:p.css("color")},s.size=p.css("line-height",1).height(),p.remove()}a=s.style+" "+s.variant+" "+s.weight+" "+s.size+"px "+s.family,c=l[i]={width:0,height:0,positions:[],lines:[],font:{definition:a,color:s.color}},h.save(),h.font=a;var d=(i+"").replace(/<br ?\/?>|\r\n|\r/g,"\n").split("\n");for(var v=0;v<d.length;++v){var m=d[v],g=h.measureText(m);c.width=Math.max(g.width,c.width),c.height+=s.lineHeight,c.lines.push({text:m,width:g.width,height:s.lineHeight})}h.restore()}return c},u.prototype.addText=function(e,n,r,s,o,u,a,f,l){if(!t.getOptions().canvas)return i.call(this,e,n,r,s,o,u,a,f,l);var c=this.getTextInfo(e,s,o,u,a),h=c.positions,p=c.lines;r+=c.height/p.length/2,l=="middle"?r=Math.round(r-c.height/2):l=="bottom"?r=Math.round(r-c.height):r=Math.round(r),!(window.opera&&window.opera.version().split(".")[0]<12)||(r-=2);for(var d=0,v;v=h[d];d++)if(v.x==n&&v.y==r){v.active=!0;return}v={active:!0,lines:[],x:n,y:r},h.push(v);for(var d=0,m;m=p[d];d++)f=="center"?v.lines.push([Math.round(n-m.width/2),r]):f=="right"?v.lines.push([Math.round(n-m.width),r]):v.lines.push([Math.round(n),r]),r+=m.height}}var t={canvas:!0},n,r,i,s=Object.prototype.hasOwnProperty;e.plot.plugins.push({init:o,options:t,name:"canvas",version:"1.0"})})(jQuery);
|
|
@ -0,0 +1,190 @@
|
|||
/* Flot plugin for plotting textual data or categories.
|
||||
|
||||
Copyright (c) 2007-2013 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
Consider a dataset like [["February", 34], ["March", 20], ...]. This plugin
|
||||
allows you to plot such a dataset directly.
|
||||
|
||||
To enable it, you must specify mode: "categories" on the axis with the textual
|
||||
labels, e.g.
|
||||
|
||||
$.plot("#placeholder", data, { xaxis: { mode: "categories" } });
|
||||
|
||||
By default, the labels are ordered as they are met in the data series. If you
|
||||
need a different ordering, you can specify "categories" on the axis options
|
||||
and list the categories there:
|
||||
|
||||
xaxis: {
|
||||
mode: "categories",
|
||||
categories: ["February", "March", "April"]
|
||||
}
|
||||
|
||||
If you need to customize the distances between the categories, you can specify
|
||||
"categories" as an object mapping labels to values
|
||||
|
||||
xaxis: {
|
||||
mode: "categories",
|
||||
categories: { "February": 1, "March": 3, "April": 4 }
|
||||
}
|
||||
|
||||
If you don't specify all categories, the remaining categories will be numbered
|
||||
from the max value plus 1 (with a spacing of 1 between each).
|
||||
|
||||
Internally, the plugin works by transforming the input data through an auto-
|
||||
generated mapping where the first category becomes 0, the second 1, etc.
|
||||
Hence, a point like ["February", 34] becomes [0, 34] internally in Flot (this
|
||||
is visible in hover and click events that return numbers rather than the
|
||||
category labels). The plugin also overrides the tick generator to spit out the
|
||||
categories as ticks instead of the values.
|
||||
|
||||
If you need to map a value back to its label, the mapping is always accessible
|
||||
as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
|
||||
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
xaxis: {
|
||||
categories: null
|
||||
},
|
||||
yaxis: {
|
||||
categories: null
|
||||
}
|
||||
};
|
||||
|
||||
function processRawData(plot, series, data, datapoints) {
|
||||
// if categories are enabled, we need to disable
|
||||
// auto-transformation to numbers so the strings are intact
|
||||
// for later processing
|
||||
|
||||
var xCategories = series.xaxis.options.mode == "categories",
|
||||
yCategories = series.yaxis.options.mode == "categories";
|
||||
|
||||
if (!(xCategories || yCategories))
|
||||
return;
|
||||
|
||||
var format = datapoints.format;
|
||||
|
||||
if (!format) {
|
||||
// FIXME: auto-detection should really not be defined here
|
||||
var s = series;
|
||||
format = [];
|
||||
format.push({ x: true, number: true, required: true });
|
||||
format.push({ y: true, number: true, required: true });
|
||||
|
||||
if (s.bars.show || (s.lines.show && s.lines.fill)) {
|
||||
var autoscale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero));
|
||||
format.push({ y: true, number: true, required: false, defaultValue: 0, autoscale: autoscale });
|
||||
if (s.bars.horizontal) {
|
||||
delete format[format.length - 1].y;
|
||||
format[format.length - 1].x = true;
|
||||
}
|
||||
}
|
||||
|
||||
datapoints.format = format;
|
||||
}
|
||||
|
||||
for (var m = 0; m < format.length; ++m) {
|
||||
if (format[m].x && xCategories)
|
||||
format[m].number = false;
|
||||
|
||||
if (format[m].y && yCategories)
|
||||
format[m].number = false;
|
||||
}
|
||||
}
|
||||
|
||||
function getNextIndex(categories) {
|
||||
var index = -1;
|
||||
|
||||
for (var v in categories)
|
||||
if (categories[v] > index)
|
||||
index = categories[v];
|
||||
|
||||
return index + 1;
|
||||
}
|
||||
|
||||
function categoriesTickGenerator(axis) {
|
||||
var res = [];
|
||||
for (var label in axis.categories) {
|
||||
var v = axis.categories[label];
|
||||
if (v >= axis.min && v <= axis.max)
|
||||
res.push([v, label]);
|
||||
}
|
||||
|
||||
res.sort(function (a, b) { return a[0] - b[0]; });
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
function setupCategoriesForAxis(series, axis, datapoints) {
|
||||
if (series[axis].options.mode != "categories")
|
||||
return;
|
||||
|
||||
if (!series[axis].categories) {
|
||||
// parse options
|
||||
var c = {}, o = series[axis].options.categories || {};
|
||||
if ($.isArray(o)) {
|
||||
for (var i = 0; i < o.length; ++i)
|
||||
c[o[i]] = i;
|
||||
}
|
||||
else {
|
||||
for (var v in o)
|
||||
c[v] = o[v];
|
||||
}
|
||||
|
||||
series[axis].categories = c;
|
||||
}
|
||||
|
||||
// fix ticks
|
||||
if (!series[axis].options.ticks)
|
||||
series[axis].options.ticks = categoriesTickGenerator;
|
||||
|
||||
transformPointsOnAxis(datapoints, axis, series[axis].categories);
|
||||
}
|
||||
|
||||
function transformPointsOnAxis(datapoints, axis, categories) {
|
||||
// go through the points, transforming them
|
||||
var points = datapoints.points,
|
||||
ps = datapoints.pointsize,
|
||||
format = datapoints.format,
|
||||
formatColumn = axis.charAt(0),
|
||||
index = getNextIndex(categories);
|
||||
|
||||
for (var i = 0; i < points.length; i += ps) {
|
||||
if (points[i] == null)
|
||||
continue;
|
||||
|
||||
for (var m = 0; m < ps; ++m) {
|
||||
var val = points[i + m];
|
||||
|
||||
if (val == null || !format[m][formatColumn])
|
||||
continue;
|
||||
|
||||
if (!(val in categories)) {
|
||||
categories[val] = index;
|
||||
++index;
|
||||
}
|
||||
|
||||
points[i + m] = categories[val];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function processDatapoints(plot, series, datapoints) {
|
||||
setupCategoriesForAxis(series, "xaxis", datapoints);
|
||||
setupCategoriesForAxis(series, "yaxis", datapoints);
|
||||
}
|
||||
|
||||
function init(plot) {
|
||||
plot.hooks.processRawData.push(processRawData);
|
||||
plot.hooks.processDatapoints.push(processDatapoints);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'categories',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
|
@ -0,0 +1,44 @@
|
|||
/* Flot plugin for plotting textual data or categories.
|
||||
|
||||
Copyright (c) 2007-2013 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
Consider a dataset like [["February", 34], ["March", 20], ...]. This plugin
|
||||
allows you to plot such a dataset directly.
|
||||
|
||||
To enable it, you must specify mode: "categories" on the axis with the textual
|
||||
labels, e.g.
|
||||
|
||||
$.plot("#placeholder", data, { xaxis: { mode: "categories" } });
|
||||
|
||||
By default, the labels are ordered as they are met in the data series. If you
|
||||
need a different ordering, you can specify "categories" on the axis options
|
||||
and list the categories there:
|
||||
|
||||
xaxis: {
|
||||
mode: "categories",
|
||||
categories: ["February", "March", "April"]
|
||||
}
|
||||
|
||||
If you need to customize the distances between the categories, you can specify
|
||||
"categories" as an object mapping labels to values
|
||||
|
||||
xaxis: {
|
||||
mode: "categories",
|
||||
categories: { "February": 1, "March": 3, "April": 4 }
|
||||
}
|
||||
|
||||
If you don't specify all categories, the remaining categories will be numbered
|
||||
from the max value plus 1 (with a spacing of 1 between each).
|
||||
|
||||
Internally, the plugin works by transforming the input data through an auto-
|
||||
generated mapping where the first category becomes 0, the second 1, etc.
|
||||
Hence, a point like ["February", 34] becomes [0, 34] internally in Flot (this
|
||||
is visible in hover and click events that return numbers rather than the
|
||||
category labels). The plugin also overrides the tick generator to spit out the
|
||||
categories as ticks instead of the values.
|
||||
|
||||
If you need to map a value back to its label, the mapping is always accessible
|
||||
as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
|
||||
|
||||
*/(function(e){function n(e,t,n,r){var i=t.xaxis.options.mode=="categories",s=t.yaxis.options.mode=="categories";if(!i&&!s)return;var o=r.format;if(!o){var u=t;o=[],o.push({x:!0,number:!0,required:!0}),o.push({y:!0,number:!0,required:!0});if(u.bars.show||u.lines.show&&u.lines.fill){var a=!!(u.bars.show&&u.bars.zero||u.lines.show&&u.lines.zero);o.push({y:!0,number:!0,required:!1,defaultValue:0,autoscale:a}),u.bars.horizontal&&(delete o[o.length-1].y,o[o.length-1].x=!0)}r.format=o}for(var f=0;f<o.length;++f)o[f].x&&i&&(o[f].number=!1),o[f].y&&s&&(o[f].number=!1)}function r(e){var t=-1;for(var n in e)e[n]>t&&(t=e[n]);return t+1}function i(e){var t=[];for(var n in e.categories){var r=e.categories[n];r>=e.min&&r<=e.max&&t.push([r,n])}return t.sort(function(e,t){return e[0]-t[0]}),t}function s(t,n,r){if(t[n].options.mode!="categories")return;if(!t[n].categories){var s={},u=t[n].options.categories||{};if(e.isArray(u))for(var a=0;a<u.length;++a)s[u[a]]=a;else for(var f in u)s[f]=u[f];t[n].categories=s}t[n].options.ticks||(t[n].options.ticks=i),o(r,n,t[n].categories)}function o(e,t,n){var i=e.points,s=e.pointsize,o=e.format,u=t.charAt(0),a=r(n);for(var f=0;f<i.length;f+=s){if(i[f]==null)continue;for(var l=0;l<s;++l){var c=i[f+l];if(c==null||!o[l][u])continue;c in n||(n[c]=a,++a),i[f+l]=n[c]}}}function u(e,t,n){s(t,"xaxis",n),s(t,"yaxis",n)}function a(e){e.hooks.processRawData.push(n),e.hooks.processDatapoints.push(u)}var t={xaxis:{categories:null},yaxis:{categories:null}};e.plot.plugins.push({init:a,options:t,name:"categories",version:"1.0"})})(jQuery);
|
|
@ -0,0 +1,176 @@
|
|||
/* Flot plugin for showing crosshairs when the mouse hovers over the plot.
|
||||
|
||||
Copyright (c) 2007-2013 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
crosshair: {
|
||||
mode: null or "x" or "y" or "xy"
|
||||
color: color
|
||||
lineWidth: number
|
||||
}
|
||||
|
||||
Set the mode to one of "x", "y" or "xy". The "x" mode enables a vertical
|
||||
crosshair that lets you trace the values on the x axis, "y" enables a
|
||||
horizontal crosshair and "xy" enables them both. "color" is the color of the
|
||||
crosshair (default is "rgba(170, 0, 0, 0.80)"), "lineWidth" is the width of
|
||||
the drawn lines (default is 1).
|
||||
|
||||
The plugin also adds four public methods:
|
||||
|
||||
- setCrosshair( pos )
|
||||
|
||||
Set the position of the crosshair. Note that this is cleared if the user
|
||||
moves the mouse. "pos" is in coordinates of the plot and should be on the
|
||||
form { x: xpos, y: ypos } (you can use x2/x3/... if you're using multiple
|
||||
axes), which is coincidentally the same format as what you get from a
|
||||
"plothover" event. If "pos" is null, the crosshair is cleared.
|
||||
|
||||
- clearCrosshair()
|
||||
|
||||
Clear the crosshair.
|
||||
|
||||
- lockCrosshair(pos)
|
||||
|
||||
Cause the crosshair to lock to the current location, no longer updating if
|
||||
the user moves the mouse. Optionally supply a position (passed on to
|
||||
setCrosshair()) to move it to.
|
||||
|
||||
Example usage:
|
||||
|
||||
var myFlot = $.plot( $("#graph"), ..., { crosshair: { mode: "x" } } };
|
||||
$("#graph").bind( "plothover", function ( evt, position, item ) {
|
||||
if ( item ) {
|
||||
// Lock the crosshair to the data point being hovered
|
||||
myFlot.lockCrosshair({
|
||||
x: item.datapoint[ 0 ],
|
||||
y: item.datapoint[ 1 ]
|
||||
});
|
||||
} else {
|
||||
// Return normal crosshair operation
|
||||
myFlot.unlockCrosshair();
|
||||
}
|
||||
});
|
||||
|
||||
- unlockCrosshair()
|
||||
|
||||
Free the crosshair to move again after locking it.
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
crosshair: {
|
||||
mode: null, // one of null, "x", "y" or "xy",
|
||||
color: "rgba(170, 0, 0, 0.80)",
|
||||
lineWidth: 1
|
||||
}
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
// position of crosshair in pixels
|
||||
var crosshair = { x: -1, y: -1, locked: false };
|
||||
|
||||
plot.setCrosshair = function setCrosshair(pos) {
|
||||
if (!pos)
|
||||
crosshair.x = -1;
|
||||
else {
|
||||
var o = plot.p2c(pos);
|
||||
crosshair.x = Math.max(0, Math.min(o.left, plot.width()));
|
||||
crosshair.y = Math.max(0, Math.min(o.top, plot.height()));
|
||||
}
|
||||
|
||||
plot.triggerRedrawOverlay();
|
||||
};
|
||||
|
||||
plot.clearCrosshair = plot.setCrosshair; // passes null for pos
|
||||
|
||||
plot.lockCrosshair = function lockCrosshair(pos) {
|
||||
if (pos)
|
||||
plot.setCrosshair(pos);
|
||||
crosshair.locked = true;
|
||||
};
|
||||
|
||||
plot.unlockCrosshair = function unlockCrosshair() {
|
||||
crosshair.locked = false;
|
||||
};
|
||||
|
||||
function onMouseOut(e) {
|
||||
if (crosshair.locked)
|
||||
return;
|
||||
|
||||
if (crosshair.x != -1) {
|
||||
crosshair.x = -1;
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
function onMouseMove(e) {
|
||||
if (crosshair.locked)
|
||||
return;
|
||||
|
||||
if (plot.getSelection && plot.getSelection()) {
|
||||
crosshair.x = -1; // hide the crosshair while selecting
|
||||
return;
|
||||
}
|
||||
|
||||
var offset = plot.offset();
|
||||
crosshair.x = Math.max(0, Math.min(e.pageX - offset.left, plot.width()));
|
||||
crosshair.y = Math.max(0, Math.min(e.pageY - offset.top, plot.height()));
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
|
||||
plot.hooks.bindEvents.push(function (plot, eventHolder) {
|
||||
if (!plot.getOptions().crosshair.mode)
|
||||
return;
|
||||
|
||||
eventHolder.mouseout(onMouseOut);
|
||||
eventHolder.mousemove(onMouseMove);
|
||||
});
|
||||
|
||||
plot.hooks.drawOverlay.push(function (plot, ctx) {
|
||||
var c = plot.getOptions().crosshair;
|
||||
if (!c.mode)
|
||||
return;
|
||||
|
||||
var plotOffset = plot.getPlotOffset();
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(plotOffset.left, plotOffset.top);
|
||||
|
||||
if (crosshair.x != -1) {
|
||||
var adj = plot.getOptions().crosshair.lineWidth % 2 === 0 ? 0 : 0.5;
|
||||
|
||||
ctx.strokeStyle = c.color;
|
||||
ctx.lineWidth = c.lineWidth;
|
||||
ctx.lineJoin = "round";
|
||||
|
||||
ctx.beginPath();
|
||||
if (c.mode.indexOf("x") != -1) {
|
||||
var drawX = Math.round(crosshair.x) + adj;
|
||||
ctx.moveTo(drawX, 0);
|
||||
ctx.lineTo(drawX, plot.height());
|
||||
}
|
||||
if (c.mode.indexOf("y") != -1) {
|
||||
var drawY = Math.round(crosshair.y) + adj;
|
||||
ctx.moveTo(0, drawY);
|
||||
ctx.lineTo(plot.width(), drawY);
|
||||
}
|
||||
ctx.stroke();
|
||||
}
|
||||
ctx.restore();
|
||||
});
|
||||
|
||||
plot.hooks.shutdown.push(function (plot, eventHolder) {
|
||||
eventHolder.unbind("mouseout", onMouseOut);
|
||||
eventHolder.unbind("mousemove", onMouseMove);
|
||||
});
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'crosshair',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
|
@ -0,0 +1,59 @@
|
|||
/* Flot plugin for showing crosshairs when the mouse hovers over the plot.
|
||||
|
||||
Copyright (c) 2007-2013 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
crosshair: {
|
||||
mode: null or "x" or "y" or "xy"
|
||||
color: color
|
||||
lineWidth: number
|
||||
}
|
||||
|
||||
Set the mode to one of "x", "y" or "xy". The "x" mode enables a vertical
|
||||
crosshair that lets you trace the values on the x axis, "y" enables a
|
||||
horizontal crosshair and "xy" enables them both. "color" is the color of the
|
||||
crosshair (default is "rgba(170, 0, 0, 0.80)"), "lineWidth" is the width of
|
||||
the drawn lines (default is 1).
|
||||
|
||||
The plugin also adds four public methods:
|
||||
|
||||
- setCrosshair( pos )
|
||||
|
||||
Set the position of the crosshair. Note that this is cleared if the user
|
||||
moves the mouse. "pos" is in coordinates of the plot and should be on the
|
||||
form { x: xpos, y: ypos } (you can use x2/x3/... if you're using multiple
|
||||
axes), which is coincidentally the same format as what you get from a
|
||||
"plothover" event. If "pos" is null, the crosshair is cleared.
|
||||
|
||||
- clearCrosshair()
|
||||
|
||||
Clear the crosshair.
|
||||
|
||||
- lockCrosshair(pos)
|
||||
|
||||
Cause the crosshair to lock to the current location, no longer updating if
|
||||
the user moves the mouse. Optionally supply a position (passed on to
|
||||
setCrosshair()) to move it to.
|
||||
|
||||
Example usage:
|
||||
|
||||
var myFlot = $.plot( $("#graph"), ..., { crosshair: { mode: "x" } } };
|
||||
$("#graph").bind( "plothover", function ( evt, position, item ) {
|
||||
if ( item ) {
|
||||
// Lock the crosshair to the data point being hovered
|
||||
myFlot.lockCrosshair({
|
||||
x: item.datapoint[ 0 ],
|
||||
y: item.datapoint[ 1 ]
|
||||
});
|
||||
} else {
|
||||
// Return normal crosshair operation
|
||||
myFlot.unlockCrosshair();
|
||||
}
|
||||
});
|
||||
|
||||
- unlockCrosshair()
|
||||
|
||||
Free the crosshair to move again after locking it.
|
||||
*/(function(e){function n(e){function n(n){if(t.locked)return;t.x!=-1&&(t.x=-1,e.triggerRedrawOverlay())}function r(n){if(t.locked)return;if(e.getSelection&&e.getSelection()){t.x=-1;return}var r=e.offset();t.x=Math.max(0,Math.min(n.pageX-r.left,e.width())),t.y=Math.max(0,Math.min(n.pageY-r.top,e.height())),e.triggerRedrawOverlay()}var t={x:-1,y:-1,locked:!1};e.setCrosshair=function(r){if(!r)t.x=-1;else{var i=e.p2c(r);t.x=Math.max(0,Math.min(i.left,e.width())),t.y=Math.max(0,Math.min(i.top,e.height()))}e.triggerRedrawOverlay()},e.clearCrosshair=e.setCrosshair,e.lockCrosshair=function(r){r&&e.setCrosshair(r),t.locked=!0},e.unlockCrosshair=function(){t.locked=!1},e.hooks.bindEvents.push(function(e,t){if(!e.getOptions().crosshair.mode)return;t.mouseout(n),t.mousemove(r)}),e.hooks.drawOverlay.push(function(e,n){var r=e.getOptions().crosshair;if(!r.mode)return;var i=e.getPlotOffset();n.save(),n.translate(i.left,i.top);if(t.x!=-1){var s=e.getOptions().crosshair.lineWidth%2===0?0:.5;n.strokeStyle=r.color,n.lineWidth=r.lineWidth,n.lineJoin="round",n.beginPath();if(r.mode.indexOf("x")!=-1){var o=Math.round(t.x)+s;n.moveTo(o,0),n.lineTo(o,e.height())}if(r.mode.indexOf("y")!=-1){var u=Math.round(t.y)+s;n.moveTo(0,u),n.lineTo(e.width(),u)}n.stroke()}n.restore()}),e.hooks.shutdown.push(function(e,t){t.unbind("mouseout",n),t.unbind("mousemove",r)})}var t={crosshair:{mode:null,color:"rgba(170, 0, 0, 0.80)",lineWidth:1}};e.plot.plugins.push({init:n,options:t,name:"crosshair",version:"1.0"})})(jQuery);
|
|
@ -0,0 +1,353 @@
|
|||
/* Flot plugin for plotting error bars.
|
||||
|
||||
Copyright (c) 2007-2013 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
Error bars are used to show standard deviation and other statistical
|
||||
properties in a plot.
|
||||
|
||||
* Created by Rui Pereira - rui (dot) pereira (at) gmail (dot) com
|
||||
|
||||
This plugin allows you to plot error-bars over points. Set "errorbars" inside
|
||||
the points series to the axis name over which there will be error values in
|
||||
your data array (*even* if you do not intend to plot them later, by setting
|
||||
"show: null" on xerr/yerr).
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
series: {
|
||||
points: {
|
||||
errorbars: "x" or "y" or "xy",
|
||||
xerr: {
|
||||
show: null/false or true,
|
||||
asymmetric: null/false or true,
|
||||
upperCap: null or "-" or function,
|
||||
lowerCap: null or "-" or function,
|
||||
color: null or color,
|
||||
radius: null or number
|
||||
},
|
||||
yerr: { same options as xerr }
|
||||
}
|
||||
}
|
||||
|
||||
Each data point array is expected to be of the type:
|
||||
|
||||
"x" [ x, y, xerr ]
|
||||
"y" [ x, y, yerr ]
|
||||
"xy" [ x, y, xerr, yerr ]
|
||||
|
||||
Where xerr becomes xerr_lower,xerr_upper for the asymmetric error case, and
|
||||
equivalently for yerr. Eg., a datapoint for the "xy" case with symmetric
|
||||
error-bars on X and asymmetric on Y would be:
|
||||
|
||||
[ x, y, xerr, yerr_lower, yerr_upper ]
|
||||
|
||||
By default no end caps are drawn. Setting upperCap and/or lowerCap to "-" will
|
||||
draw a small cap perpendicular to the error bar. They can also be set to a
|
||||
user-defined drawing function, with (ctx, x, y, radius) as parameters, as eg.
|
||||
|
||||
function drawSemiCircle( ctx, x, y, radius ) {
|
||||
ctx.beginPath();
|
||||
ctx.arc( x, y, radius, 0, Math.PI, false );
|
||||
ctx.moveTo( x - radius, y );
|
||||
ctx.lineTo( x + radius, y );
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
Color and radius both default to the same ones of the points series if not
|
||||
set. The independent radius parameter on xerr/yerr is useful for the case when
|
||||
we may want to add error-bars to a line, without showing the interconnecting
|
||||
points (with radius: 0), and still showing end caps on the error-bars.
|
||||
shadowSize and lineWidth are derived as well from the points series.
|
||||
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
series: {
|
||||
points: {
|
||||
errorbars: null, //should be 'x', 'y' or 'xy'
|
||||
xerr: { err: 'x', show: null, asymmetric: null, upperCap: null, lowerCap: null, color: null, radius: null},
|
||||
yerr: { err: 'y', show: null, asymmetric: null, upperCap: null, lowerCap: null, color: null, radius: null}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function processRawData(plot, series, data, datapoints){
|
||||
if (!series.points.errorbars)
|
||||
return;
|
||||
|
||||
// x,y values
|
||||
var format = [
|
||||
{ x: true, number: true, required: true },
|
||||
{ y: true, number: true, required: true }
|
||||
];
|
||||
|
||||
var errors = series.points.errorbars;
|
||||
// error bars - first X then Y
|
||||
if (errors == 'x' || errors == 'xy') {
|
||||
// lower / upper error
|
||||
if (series.points.xerr.asymmetric) {
|
||||
format.push({ x: true, number: true, required: true });
|
||||
format.push({ x: true, number: true, required: true });
|
||||
} else
|
||||
format.push({ x: true, number: true, required: true });
|
||||
}
|
||||
if (errors == 'y' || errors == 'xy') {
|
||||
// lower / upper error
|
||||
if (series.points.yerr.asymmetric) {
|
||||
format.push({ y: true, number: true, required: true });
|
||||
format.push({ y: true, number: true, required: true });
|
||||
} else
|
||||
format.push({ y: true, number: true, required: true });
|
||||
}
|
||||
datapoints.format = format;
|
||||
}
|
||||
|
||||
function parseErrors(series, i){
|
||||
|
||||
var points = series.datapoints.points;
|
||||
|
||||
// read errors from points array
|
||||
var exl = null,
|
||||
exu = null,
|
||||
eyl = null,
|
||||
eyu = null;
|
||||
var xerr = series.points.xerr,
|
||||
yerr = series.points.yerr;
|
||||
|
||||
var eb = series.points.errorbars;
|
||||
// error bars - first X
|
||||
if (eb == 'x' || eb == 'xy') {
|
||||
if (xerr.asymmetric) {
|
||||
exl = points[i + 2];
|
||||
exu = points[i + 3];
|
||||
if (eb == 'xy')
|
||||
if (yerr.asymmetric){
|
||||
eyl = points[i + 4];
|
||||
eyu = points[i + 5];
|
||||
} else eyl = points[i + 4];
|
||||
} else {
|
||||
exl = points[i + 2];
|
||||
if (eb == 'xy')
|
||||
if (yerr.asymmetric) {
|
||||
eyl = points[i + 3];
|
||||
eyu = points[i + 4];
|
||||
} else eyl = points[i + 3];
|
||||
}
|
||||
// only Y
|
||||
} else if (eb == 'y')
|
||||
if (yerr.asymmetric) {
|
||||
eyl = points[i + 2];
|
||||
eyu = points[i + 3];
|
||||
} else eyl = points[i + 2];
|
||||
|
||||
// symmetric errors?
|
||||
if (exu == null) exu = exl;
|
||||
if (eyu == null) eyu = eyl;
|
||||
|
||||
var errRanges = [exl, exu, eyl, eyu];
|
||||
// nullify if not showing
|
||||
if (!xerr.show){
|
||||
errRanges[0] = null;
|
||||
errRanges[1] = null;
|
||||
}
|
||||
if (!yerr.show){
|
||||
errRanges[2] = null;
|
||||
errRanges[3] = null;
|
||||
}
|
||||
return errRanges;
|
||||
}
|
||||
|
||||
function drawSeriesErrors(plot, ctx, s){
|
||||
|
||||
var points = s.datapoints.points,
|
||||
ps = s.datapoints.pointsize,
|
||||
ax = [s.xaxis, s.yaxis],
|
||||
radius = s.points.radius,
|
||||
err = [s.points.xerr, s.points.yerr];
|
||||
|
||||
//sanity check, in case some inverted axis hack is applied to flot
|
||||
var invertX = false;
|
||||
if (ax[0].p2c(ax[0].max) < ax[0].p2c(ax[0].min)) {
|
||||
invertX = true;
|
||||
var tmp = err[0].lowerCap;
|
||||
err[0].lowerCap = err[0].upperCap;
|
||||
err[0].upperCap = tmp;
|
||||
}
|
||||
|
||||
var invertY = false;
|
||||
if (ax[1].p2c(ax[1].min) < ax[1].p2c(ax[1].max)) {
|
||||
invertY = true;
|
||||
var tmp = err[1].lowerCap;
|
||||
err[1].lowerCap = err[1].upperCap;
|
||||
err[1].upperCap = tmp;
|
||||
}
|
||||
|
||||
for (var i = 0; i < s.datapoints.points.length; i += ps) {
|
||||
|
||||
//parse
|
||||
var errRanges = parseErrors(s, i);
|
||||
|
||||
//cycle xerr & yerr
|
||||
for (var e = 0; e < err.length; e++){
|
||||
|
||||
var minmax = [ax[e].min, ax[e].max];
|
||||
|
||||
//draw this error?
|
||||
if (errRanges[e * err.length]){
|
||||
|
||||
//data coordinates
|
||||
var x = points[i],
|
||||
y = points[i + 1];
|
||||
|
||||
//errorbar ranges
|
||||
var upper = [x, y][e] + errRanges[e * err.length + 1],
|
||||
lower = [x, y][e] - errRanges[e * err.length];
|
||||
|
||||
//points outside of the canvas
|
||||
if (err[e].err == 'x')
|
||||
if (y > ax[1].max || y < ax[1].min || upper < ax[0].min || lower > ax[0].max)
|
||||
continue;
|
||||
if (err[e].err == 'y')
|
||||
if (x > ax[0].max || x < ax[0].min || upper < ax[1].min || lower > ax[1].max)
|
||||
continue;
|
||||
|
||||
// prevent errorbars getting out of the canvas
|
||||
var drawUpper = true,
|
||||
drawLower = true;
|
||||
|
||||
if (upper > minmax[1]) {
|
||||
drawUpper = false;
|
||||
upper = minmax[1];
|
||||
}
|
||||
if (lower < minmax[0]) {
|
||||
drawLower = false;
|
||||
lower = minmax[0];
|
||||
}
|
||||
|
||||
//sanity check, in case some inverted axis hack is applied to flot
|
||||
if ((err[e].err == 'x' && invertX) || (err[e].err == 'y' && invertY)) {
|
||||
//swap coordinates
|
||||
var tmp = lower;
|
||||
lower = upper;
|
||||
upper = tmp;
|
||||
tmp = drawLower;
|
||||
drawLower = drawUpper;
|
||||
drawUpper = tmp;
|
||||
tmp = minmax[0];
|
||||
minmax[0] = minmax[1];
|
||||
minmax[1] = tmp;
|
||||
}
|
||||
|
||||
// convert to pixels
|
||||
x = ax[0].p2c(x),
|
||||
y = ax[1].p2c(y),
|
||||
upper = ax[e].p2c(upper);
|
||||
lower = ax[e].p2c(lower);
|
||||
minmax[0] = ax[e].p2c(minmax[0]);
|
||||
minmax[1] = ax[e].p2c(minmax[1]);
|
||||
|
||||
//same style as points by default
|
||||
var lw = err[e].lineWidth ? err[e].lineWidth : s.points.lineWidth,
|
||||
sw = s.points.shadowSize != null ? s.points.shadowSize : s.shadowSize;
|
||||
|
||||
//shadow as for points
|
||||
if (lw > 0 && sw > 0) {
|
||||
var w = sw / 2;
|
||||
ctx.lineWidth = w;
|
||||
ctx.strokeStyle = "rgba(0,0,0,0.1)";
|
||||
drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, w + w/2, minmax);
|
||||
|
||||
ctx.strokeStyle = "rgba(0,0,0,0.2)";
|
||||
drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, w/2, minmax);
|
||||
}
|
||||
|
||||
ctx.strokeStyle = err[e].color? err[e].color: s.color;
|
||||
ctx.lineWidth = lw;
|
||||
//draw it
|
||||
drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, 0, minmax);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function drawError(ctx,err,x,y,upper,lower,drawUpper,drawLower,radius,offset,minmax){
|
||||
|
||||
//shadow offset
|
||||
y += offset;
|
||||
upper += offset;
|
||||
lower += offset;
|
||||
|
||||
// error bar - avoid plotting over circles
|
||||
if (err.err == 'x'){
|
||||
if (upper > x + radius) drawPath(ctx, [[upper,y],[Math.max(x + radius,minmax[0]),y]]);
|
||||
else drawUpper = false;
|
||||
if (lower < x - radius) drawPath(ctx, [[Math.min(x - radius,minmax[1]),y],[lower,y]] );
|
||||
else drawLower = false;
|
||||
}
|
||||
else {
|
||||
if (upper < y - radius) drawPath(ctx, [[x,upper],[x,Math.min(y - radius,minmax[0])]] );
|
||||
else drawUpper = false;
|
||||
if (lower > y + radius) drawPath(ctx, [[x,Math.max(y + radius,minmax[1])],[x,lower]] );
|
||||
else drawLower = false;
|
||||
}
|
||||
|
||||
//internal radius value in errorbar, allows to plot radius 0 points and still keep proper sized caps
|
||||
//this is a way to get errorbars on lines without visible connecting dots
|
||||
radius = err.radius != null? err.radius: radius;
|
||||
|
||||
// upper cap
|
||||
if (drawUpper) {
|
||||
if (err.upperCap == '-'){
|
||||
if (err.err=='x') drawPath(ctx, [[upper,y - radius],[upper,y + radius]] );
|
||||
else drawPath(ctx, [[x - radius,upper],[x + radius,upper]] );
|
||||
} else if ($.isFunction(err.upperCap)){
|
||||
if (err.err=='x') err.upperCap(ctx, upper, y, radius);
|
||||
else err.upperCap(ctx, x, upper, radius);
|
||||
}
|
||||
}
|
||||
// lower cap
|
||||
if (drawLower) {
|
||||
if (err.lowerCap == '-'){
|
||||
if (err.err=='x') drawPath(ctx, [[lower,y - radius],[lower,y + radius]] );
|
||||
else drawPath(ctx, [[x - radius,lower],[x + radius,lower]] );
|
||||
} else if ($.isFunction(err.lowerCap)){
|
||||
if (err.err=='x') err.lowerCap(ctx, lower, y, radius);
|
||||
else err.lowerCap(ctx, x, lower, radius);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function drawPath(ctx, pts){
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(pts[0][0], pts[0][1]);
|
||||
for (var p=1; p < pts.length; p++)
|
||||
ctx.lineTo(pts[p][0], pts[p][1]);
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
function draw(plot, ctx){
|
||||
var plotOffset = plot.getPlotOffset();
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(plotOffset.left, plotOffset.top);
|
||||
$.each(plot.getData(), function (i, s) {
|
||||
if (s.points.errorbars && (s.points.xerr.show || s.points.yerr.show))
|
||||
drawSeriesErrors(plot, ctx, s);
|
||||
});
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
function init(plot) {
|
||||
plot.hooks.processRawData.push(processRawData);
|
||||
plot.hooks.draw.push(draw);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'errorbars',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
|
@ -0,0 +1,63 @@
|
|||
/* Flot plugin for plotting error bars.
|
||||
|
||||
Copyright (c) 2007-2013 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
Error bars are used to show standard deviation and other statistical
|
||||
properties in a plot.
|
||||
|
||||
* Created by Rui Pereira - rui (dot) pereira (at) gmail (dot) com
|
||||
|
||||
This plugin allows you to plot error-bars over points. Set "errorbars" inside
|
||||
the points series to the axis name over which there will be error values in
|
||||
your data array (*even* if you do not intend to plot them later, by setting
|
||||
"show: null" on xerr/yerr).
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
series: {
|
||||
points: {
|
||||
errorbars: "x" or "y" or "xy",
|
||||
xerr: {
|
||||
show: null/false or true,
|
||||
asymmetric: null/false or true,
|
||||
upperCap: null or "-" or function,
|
||||
lowerCap: null or "-" or function,
|
||||
color: null or color,
|
||||
radius: null or number
|
||||
},
|
||||
yerr: { same options as xerr }
|
||||
}
|
||||
}
|
||||
|
||||
Each data point array is expected to be of the type:
|
||||
|
||||
"x" [ x, y, xerr ]
|
||||
"y" [ x, y, yerr ]
|
||||
"xy" [ x, y, xerr, yerr ]
|
||||
|
||||
Where xerr becomes xerr_lower,xerr_upper for the asymmetric error case, and
|
||||
equivalently for yerr. Eg., a datapoint for the "xy" case with symmetric
|
||||
error-bars on X and asymmetric on Y would be:
|
||||
|
||||
[ x, y, xerr, yerr_lower, yerr_upper ]
|
||||
|
||||
By default no end caps are drawn. Setting upperCap and/or lowerCap to "-" will
|
||||
draw a small cap perpendicular to the error bar. They can also be set to a
|
||||
user-defined drawing function, with (ctx, x, y, radius) as parameters, as eg.
|
||||
|
||||
function drawSemiCircle( ctx, x, y, radius ) {
|
||||
ctx.beginPath();
|
||||
ctx.arc( x, y, radius, 0, Math.PI, false );
|
||||
ctx.moveTo( x - radius, y );
|
||||
ctx.lineTo( x + radius, y );
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
Color and radius both default to the same ones of the points series if not
|
||||
set. The independent radius parameter on xerr/yerr is useful for the case when
|
||||
we may want to add error-bars to a line, without showing the interconnecting
|
||||
points (with radius: 0), and still showing end caps on the error-bars.
|
||||
shadowSize and lineWidth are derived as well from the points series.
|
||||
|
||||
*/(function(e){function n(e,t,n,r){if(!t.points.errorbars)return;var i=[{x:!0,number:!0,required:!0},{y:!0,number:!0,required:!0}],s=t.points.errorbars;if(s=="x"||s=="xy")t.points.xerr.asymmetric?(i.push({x:!0,number:!0,required:!0}),i.push({x:!0,number:!0,required:!0})):i.push({x:!0,number:!0,required:!0});if(s=="y"||s=="xy")t.points.yerr.asymmetric?(i.push({y:!0,number:!0,required:!0}),i.push({y:!0,number:!0,required:!0})):i.push({y:!0,number:!0,required:!0});r.format=i}function r(e,t){var n=e.datapoints.points,r=null,i=null,s=null,o=null,u=e.points.xerr,a=e.points.yerr,f=e.points.errorbars;f=="x"||f=="xy"?u.asymmetric?(r=n[t+2],i=n[t+3],f=="xy"&&(a.asymmetric?(s=n[t+4],o=n[t+5]):s=n[t+4])):(r=n[t+2],f=="xy"&&(a.asymmetric?(s=n[t+3],o=n[t+4]):s=n[t+3])):f=="y"&&(a.asymmetric?(s=n[t+2],o=n[t+3]):s=n[t+2]),i==null&&(i=r),o==null&&(o=s);var l=[r,i,s,o];return u.show||(l[0]=null,l[1]=null),a.show||(l[2]=null,l[3]=null),l}function i(e,t,n){var i=n.datapoints.points,o=n.datapoints.pointsize,u=[n.xaxis,n.yaxis],a=n.points.radius,f=[n.points.xerr,n.points.yerr],l=!1;if(u[0].p2c(u[0].max)<u[0].p2c(u[0].min)){l=!0;var c=f[0].lowerCap;f[0].lowerCap=f[0].upperCap,f[0].upperCap=c}var h=!1;if(u[1].p2c(u[1].min)<u[1].p2c(u[1].max)){h=!0;var c=f[1].lowerCap;f[1].lowerCap=f[1].upperCap,f[1].upperCap=c}for(var p=0;p<n.datapoints.points.length;p+=o){var d=r(n,p);for(var v=0;v<f.length;v++){var m=[u[v].min,u[v].max];if(d[v*f.length]){var g=i[p],y=i[p+1],b=[g,y][v]+d[v*f.length+1],w=[g,y][v]-d[v*f.length];if(f[v].err=="x")if(y>u[1].max||y<u[1].min||b<u[0].min||w>u[0].max)continue;if(f[v].err=="y")if(g>u[0].max||g<u[0].min||b<u[1].min||w>u[1].max)continue;var E=!0,S=!0;b>m[1]&&(E=!1,b=m[1]),w<m[0]&&(S=!1,w=m[0]);if(f[v].err=="x"&&l||f[v].err=="y"&&h){var c=w;w=b,b=c,c=S,S=E,E=c,c=m[0],m[0]=m[1],m[1]=c}g=u[0].p2c(g),y=u[1].p2c(y),b=u[v].p2c(b),w=u[v].p2c(w),m[0]=u[v].p2c(m[0]),m[1]=u[v].p2c(m[1]);var x=f[v].lineWidth?f[v].lineWidth:n.points.lineWidth,T=n.points.shadowSize!=null?n.points.shadowSize:n.shadowSize;if(x>0&&T>0){var N=T/2;t.lineWidth=N,t.strokeStyle="rgba(0,0,0,0.1)",s(t,f[v],g,y,b,w,E,S,a,N+N/2,m),t.strokeStyle="rgba(0,0,0,0.2)",s(t,f[v],g,y,b,w,E,S,a,N/2,m)}t.strokeStyle=f[v].color?f[v].color:n.color,t.lineWidth=x,s(t,f[v],g,y,b,w,E,S,a,0,m)}}}}function s(t,n,r,i,s,u,a,f,l,c,h){i+=c,s+=c,u+=c,n.err=="x"?(s>r+l?o(t,[[s,i],[Math.max(r+l,h[0]),i]]):a=!1,u<r-l?o(t,[[Math.min(r-l,h[1]),i],[u,i]]):f=!1):(s<i-l?o(t,[[r,s],[r,Math.min(i-l,h[0])]]):a=!1,u>i+l?o(t,[[r,Math.max(i+l,h[1])],[r,u]]):f=!1),l=n.radius!=null?n.radius:l,a&&(n.upperCap=="-"?n.err=="x"?o(t,[[s,i-l],[s,i+l]]):o(t,[[r-l,s],[r+l,s]]):e.isFunction(n.upperCap)&&(n.err=="x"?n.upperCap(t,s,i,l):n.upperCap(t,r,s,l))),f&&(n.lowerCap=="-"?n.err=="x"?o(t,[[u,i-l],[u,i+l]]):o(t,[[r-l,u],[r+l,u]]):e.isFunction(n.lowerCap)&&(n.err=="x"?n.lowerCap(t,u,i,l):n.lowerCap(t,r,u,l)))}function o(e,t){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(var n=1;n<t.length;n++)e.lineTo(t[n][0],t[n][1]);e.stroke()}function u(t,n){var r=t.getPlotOffset();n.save(),n.translate(r.left,r.top),e.each(t.getData(),function(e,r){r.points.errorbars&&(r.points.xerr.show||r.points.yerr.show)&&i(t,n,r)}),n.restore()}function a(e){e.hooks.processRawData.push(n),e.hooks.draw.push(u)}var t={series:{points:{errorbars:null,xerr:{err:"x",show:null,asymmetric:null,upperCap:null,lowerCap:null,color:null,radius:null},yerr:{err:"y",show:null,asymmetric:null,upperCap:null,lowerCap:null,color:null,radius:null}}}};e.plot.plugins.push({init:a,options:t,name:"errorbars",version:"1.0"})})(jQuery);
|
|
@ -0,0 +1,226 @@
|
|||
/* Flot plugin for computing bottoms for filled line and bar charts.
|
||||
|
||||
Copyright (c) 2007-2013 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The case: you've got two series that you want to fill the area between. In Flot
|
||||
terms, you need to use one as the fill bottom of the other. You can specify the
|
||||
bottom of each data point as the third coordinate manually, or you can use this
|
||||
plugin to compute it for you.
|
||||
|
||||
In order to name the other series, you need to give it an id, like this:
|
||||
|
||||
var dataset = [
|
||||
{ data: [ ... ], id: "foo" } , // use default bottom
|
||||
{ data: [ ... ], fillBetween: "foo" }, // use first dataset as bottom
|
||||
];
|
||||
|
||||
$.plot($("#placeholder"), dataset, { lines: { show: true, fill: true }});
|
||||
|
||||
As a convenience, if the id given is a number that doesn't appear as an id in
|
||||
the series, it is interpreted as the index in the array instead (so fillBetween:
|
||||
0 can also mean the first series).
|
||||
|
||||
Internally, the plugin modifies the datapoints in each series. For line series,
|
||||
extra data points might be inserted through interpolation. Note that at points
|
||||
where the bottom line is not defined (due to a null point or start/end of line),
|
||||
the current line will show a gap too. The algorithm comes from the
|
||||
jquery.flot.stack.js plugin, possibly some code could be shared.
|
||||
|
||||
*/
|
||||
|
||||
(function ( $ ) {
|
||||
|
||||
var options = {
|
||||
series: {
|
||||
fillBetween: null // or number
|
||||
}
|
||||
};
|
||||
|
||||
function init( plot ) {
|
||||
|
||||
function findBottomSeries( s, allseries ) {
|
||||
|
||||
var i;
|
||||
|
||||
for ( i = 0; i < allseries.length; ++i ) {
|
||||
if ( allseries[ i ].id === s.fillBetween ) {
|
||||
return allseries[ i ];
|
||||
}
|
||||
}
|
||||
|
||||
if ( typeof s.fillBetween === "number" ) {
|
||||
if ( s.fillBetween < 0 || s.fillBetween >= allseries.length ) {
|
||||
return null;
|
||||
}
|
||||
return allseries[ s.fillBetween ];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function computeFillBottoms( plot, s, datapoints ) {
|
||||
|
||||
if ( s.fillBetween == null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var other = findBottomSeries( s, plot.getData() );
|
||||
|
||||
if ( !other ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var ps = datapoints.pointsize,
|
||||
points = datapoints.points,
|
||||
otherps = other.datapoints.pointsize,
|
||||
otherpoints = other.datapoints.points,
|
||||
newpoints = [],
|
||||
px, py, intery, qx, qy, bottom,
|
||||
withlines = s.lines.show,
|
||||
withbottom = ps > 2 && datapoints.format[2].y,
|
||||
withsteps = withlines && s.lines.steps,
|
||||
fromgap = true,
|
||||
i = 0,
|
||||
j = 0,
|
||||
l, m;
|
||||
|
||||
while ( true ) {
|
||||
|
||||
if ( i >= points.length ) {
|
||||
break;
|
||||
}
|
||||
|
||||
l = newpoints.length;
|
||||
|
||||
if ( points[ i ] == null ) {
|
||||
|
||||
// copy gaps
|
||||
|
||||
for ( m = 0; m < ps; ++m ) {
|
||||
newpoints.push( points[ i + m ] );
|
||||
}
|
||||
|
||||
i += ps;
|
||||
|
||||
} else if ( j >= otherpoints.length ) {
|
||||
|
||||
// for lines, we can't use the rest of the points
|
||||
|
||||
if ( !withlines ) {
|
||||
for ( m = 0; m < ps; ++m ) {
|
||||
newpoints.push( points[ i + m ] );
|
||||
}
|
||||
}
|
||||
|
||||
i += ps;
|
||||
|
||||
} else if ( otherpoints[ j ] == null ) {
|
||||
|
||||
// oops, got a gap
|
||||
|
||||
for ( m = 0; m < ps; ++m ) {
|
||||
newpoints.push( null );
|
||||
}
|
||||
|
||||
fromgap = true;
|
||||
j += otherps;
|
||||
|
||||
} else {
|
||||
|
||||
// cases where we actually got two points
|
||||
|
||||
px = points[ i ];
|
||||
py = points[ i + 1 ];
|
||||
qx = otherpoints[ j ];
|
||||
qy = otherpoints[ j + 1 ];
|
||||
bottom = 0;
|
||||
|
||||
if ( px === qx ) {
|
||||
|
||||
for ( m = 0; m < ps; ++m ) {
|
||||
newpoints.push( points[ i + m ] );
|
||||
}
|
||||
|
||||
//newpoints[ l + 1 ] += qy;
|
||||
bottom = qy;
|
||||
|
||||
i += ps;
|
||||
j += otherps;
|
||||
|
||||
} else if ( px > qx ) {
|
||||
|
||||
// we got past point below, might need to
|
||||
// insert interpolated extra point
|
||||
|
||||
if ( withlines && i > 0 && points[ i - ps ] != null ) {
|
||||
intery = py + ( points[ i - ps + 1 ] - py ) * ( qx - px ) / ( points[ i - ps ] - px );
|
||||
newpoints.push( qx );
|
||||
newpoints.push( intery );
|
||||
for ( m = 2; m < ps; ++m ) {
|
||||
newpoints.push( points[ i + m ] );
|
||||
}
|
||||
bottom = qy;
|
||||
}
|
||||
|
||||
j += otherps;
|
||||
|
||||
} else { // px < qx
|
||||
|
||||
// if we come from a gap, we just skip this point
|
||||
|
||||
if ( fromgap && withlines ) {
|
||||
i += ps;
|
||||
continue;
|
||||
}
|
||||
|
||||
for ( m = 0; m < ps; ++m ) {
|
||||
newpoints.push( points[ i + m ] );
|
||||
}
|
||||
|
||||
// we might be able to interpolate a point below,
|
||||
// this can give us a better y
|
||||
|
||||
if ( withlines && j > 0 && otherpoints[ j - otherps ] != null ) {
|
||||
bottom = qy + ( otherpoints[ j - otherps + 1 ] - qy ) * ( px - qx ) / ( otherpoints[ j - otherps ] - qx );
|
||||
}
|
||||
|
||||
//newpoints[l + 1] += bottom;
|
||||
|
||||
i += ps;
|
||||
}
|
||||
|
||||
fromgap = false;
|
||||
|
||||
if ( l !== newpoints.length && withbottom ) {
|
||||
newpoints[ l + 2 ] = bottom;
|
||||
}
|
||||
}
|
||||
|
||||
// maintain the line steps invariant
|
||||
|
||||
if ( withsteps && l !== newpoints.length && l > 0 &&
|
||||
newpoints[ l ] !== null &&
|
||||
newpoints[ l ] !== newpoints[ l - ps ] &&
|
||||
newpoints[ l + 1 ] !== newpoints[ l - ps + 1 ] ) {
|
||||
for (m = 0; m < ps; ++m) {
|
||||
newpoints[ l + ps + m ] = newpoints[ l + m ];
|
||||
}
|
||||
newpoints[ l + 1 ] = newpoints[ l - ps + 1 ];
|
||||
}
|
||||
}
|
||||
|
||||
datapoints.points = newpoints;
|
||||
}
|
||||
|
||||
plot.hooks.processDatapoints.push( computeFillBottoms );
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: "fillbetween",
|
||||
version: "1.0"
|
||||
});
|
||||
|
||||
})(jQuery);
|
|
@ -0,0 +1,30 @@
|
|||
/* Flot plugin for computing bottoms for filled line and bar charts.
|
||||
|
||||
Copyright (c) 2007-2013 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The case: you've got two series that you want to fill the area between. In Flot
|
||||
terms, you need to use one as the fill bottom of the other. You can specify the
|
||||
bottom of each data point as the third coordinate manually, or you can use this
|
||||
plugin to compute it for you.
|
||||
|
||||
In order to name the other series, you need to give it an id, like this:
|
||||
|
||||
var dataset = [
|
||||
{ data: [ ... ], id: "foo" } , // use default bottom
|
||||
{ data: [ ... ], fillBetween: "foo" }, // use first dataset as bottom
|
||||
];
|
||||
|
||||
$.plot($("#placeholder"), dataset, { lines: { show: true, fill: true }});
|
||||
|
||||
As a convenience, if the id given is a number that doesn't appear as an id in
|
||||
the series, it is interpreted as the index in the array instead (so fillBetween:
|
||||
0 can also mean the first series).
|
||||
|
||||
Internally, the plugin modifies the datapoints in each series. For line series,
|
||||
extra data points might be inserted through interpolation. Note that at points
|
||||
where the bottom line is not defined (due to a null point or start/end of line),
|
||||
the current line will show a gap too. The algorithm comes from the
|
||||
jquery.flot.stack.js plugin, possibly some code could be shared.
|
||||
|
||||
*/(function(e){function n(e){function t(e,t){var n;for(n=0;n<t.length;++n)if(t[n].id===e.fillBetween)return t[n];return typeof e.fillBetween=="number"?e.fillBetween<0||e.fillBetween>=t.length?null:t[e.fillBetween]:null}function n(e,n,r){if(n.fillBetween==null)return;var i=t(n,e.getData());if(!i)return;var s=r.pointsize,o=r.points,u=i.datapoints.pointsize,a=i.datapoints.points,f=[],l,c,h,p,d,v,m=n.lines.show,g=s>2&&r.format[2].y,y=m&&n.lines.steps,b=!0,w=0,E=0,S,x;for(;;){if(w>=o.length)break;S=f.length;if(o[w]==null){for(x=0;x<s;++x)f.push(o[w+x]);w+=s}else if(E>=a.length){if(!m)for(x=0;x<s;++x)f.push(o[w+x]);w+=s}else if(a[E]==null){for(x=0;x<s;++x)f.push(null);b=!0,E+=u}else{l=o[w],c=o[w+1],p=a[E],d=a[E+1],v=0;if(l===p){for(x=0;x<s;++x)f.push(o[w+x]);v=d,w+=s,E+=u}else if(l>p){if(m&&w>0&&o[w-s]!=null){h=c+(o[w-s+1]-c)*(p-l)/(o[w-s]-l),f.push(p),f.push(h);for(x=2;x<s;++x)f.push(o[w+x]);v=d}E+=u}else{if(b&&m){w+=s;continue}for(x=0;x<s;++x)f.push(o[w+x]);m&&E>0&&a[E-u]!=null&&(v=d+(a[E-u+1]-d)*(l-p)/(a[E-u]-p)),w+=s}b=!1,S!==f.length&&g&&(f[S+2]=v)}if(y&&S!==f.length&&S>0&&f[S]!==null&&f[S]!==f[S-s]&&f[S+1]!==f[S-s+1]){for(x=0;x<s;++x)f[S+s+x]=f[S+x];f[S+1]=f[S-s+1]}}r.points=f}e.hooks.processDatapoints.push(n)}var t={series:{fillBetween:null}};e.plot.plugins.push({init:n,options:t,name:"fillbetween",version:"1.0"})})(jQuery);
|
|
@ -0,0 +1,371 @@
|
|||
/*
|
||||
* The MIT License
|
||||
|
||||
This is a fork of jquery.flot.grow by Thodoris Greasidis,
|
||||
that implements the growing animations using requestAnimationFrame
|
||||
and introduces varius bug fixes and improvements.
|
||||
|
||||
Copyright (c) 2013 by Thodoris Greasidis
|
||||
|
||||
Copyright (c) 2010,2011,2012, 2013 by Juergen Marsch
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
"use strict";
|
||||
var pluginName = "growraf", pluginVersion = "0.4.5";
|
||||
var options = {
|
||||
series: {
|
||||
grow: {
|
||||
active: false,
|
||||
//stepDelay: 20,
|
||||
//steps: 100,
|
||||
duration: 1000,
|
||||
valueIndex: 1,
|
||||
reanimate: true,
|
||||
growings: [
|
||||
{
|
||||
valueIndex: 1,
|
||||
stepMode: "linear",
|
||||
stepDirection: "up",
|
||||
reanimate: "continue"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/** @enum {number} */
|
||||
var GrowPhase = {
|
||||
NOT_PLOTTED_YET: 0,
|
||||
PLOTTED_SOME_FRAMES: 1,
|
||||
PLOTTED_LAST_FRAME: 2
|
||||
};
|
||||
|
||||
var growFunctions = {
|
||||
none: function (dataj, timePassed, growing, growPhase) {
|
||||
if (growPhase === GrowPhase.NOT_PLOTTED_YET) {
|
||||
for (var i = 0, djdatalen = dataj.data.length; i < djdatalen; i++) {
|
||||
dataj.data[i][growing.valueIndex] = dataj.dataOrg[i][growing.valueIndex];
|
||||
}
|
||||
}
|
||||
},
|
||||
linear: function (dataj, timePassed, growing, growPhase) {
|
||||
var percentage = Math.min(timePassed / dataj.grow.duration, 1);
|
||||
|
||||
for (var i = 0, djdatalen = dataj.data.length; i < djdatalen; i++) {
|
||||
var originalValue = dataj.dataOrg[i][growing.valueIndex];
|
||||
|
||||
if (originalValue !== null) {
|
||||
if (growing.stepDirection === 'up') {
|
||||
dataj.data[i][growing.valueIndex] = originalValue * percentage;
|
||||
}
|
||||
else if (growing.stepDirection === 'down') {
|
||||
dataj.data[i][growing.valueIndex] = originalValue + (dataj.yaxis.max - originalValue) * (1 - percentage);
|
||||
}
|
||||
} else {
|
||||
dataj.data[i][growing.valueIndex] = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
maximum: function (dataj, timePassed, growing, growPhase) {
|
||||
var percentage = Math.min(timePassed / dataj.grow.duration, 1);
|
||||
|
||||
var upMax = dataj.yaxis.max * percentage,
|
||||
upMin = dataj.yaxis.min * percentage,
|
||||
downMax = dataj.yaxis.max * (1 - percentage),
|
||||
downMin = dataj.yaxis.min * (1 - percentage);
|
||||
for (var i = 0, djdatalen = dataj.data.length; i < djdatalen; i++) {
|
||||
var originalValue = dataj.dataOrg[i][growing.valueIndex];
|
||||
|
||||
if (originalValue !== null) {
|
||||
if (growing.stepDirection === 'up') {
|
||||
if (originalValue >= 0) {
|
||||
dataj.data[i][growing.valueIndex] = Math.min(originalValue, upMax);
|
||||
} else {
|
||||
dataj.data[i][growing.valueIndex] = Math.max(originalValue, upMin);
|
||||
}
|
||||
}
|
||||
else if (growing.stepDirection === 'down') {
|
||||
if (originalValue >= 0) {
|
||||
dataj.data[i][growing.valueIndex] = Math.max(originalValue, downMax);
|
||||
} else {
|
||||
dataj.data[i][growing.valueIndex] = Math.min(originalValue, downMin);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dataj.data[i][growing.valueIndex] = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
delay: function (dataj, timePassed, growing, growPhase) {
|
||||
if (timePassed >= dataj.grow.duration) {
|
||||
for (var i = 0, djdatalen = dataj.data.length; i < djdatalen; i++) {
|
||||
dataj.data[i][growing.valueIndex] = dataj.dataOrg[i][growing.valueIndex];
|
||||
}
|
||||
}
|
||||
},
|
||||
reanimate: function (dataj, timePassed, growing, growPhase) {
|
||||
var percentage = Math.min(timePassed / dataj.grow.duration, 1);
|
||||
|
||||
for (var i = 0, djdatalen = dataj.data.length; i < djdatalen; i++) {
|
||||
var targetValue = dataj.dataOrg[i][growing.valueIndex];
|
||||
|
||||
if (targetValue === null) {
|
||||
dataj.data[i][growing.valueIndex] = null;
|
||||
} else if (dataj.dataOld) {
|
||||
var oldData = dataj.dataOld[i][growing.valueIndex];
|
||||
dataj.data[i][growing.valueIndex] = oldData + (targetValue - oldData) * percentage;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var requestAnimationFrame;
|
||||
var cancelAnimationFrame;
|
||||
polyfillLocalRequestAnimationFrame();
|
||||
|
||||
function init(plot) {
|
||||
// State variables
|
||||
var processSeriesDone = false;
|
||||
var initGrowingLoop = true;
|
||||
var startTime = 0, timePassed = 0, growPhase = GrowPhase.NOT_PLOTTED_YET;
|
||||
var dataOld = [];
|
||||
|
||||
var growfunc;
|
||||
var plt = plot;
|
||||
var data = null;
|
||||
var opt = null;
|
||||
plot.hooks.drawSeries.push(processSeries);
|
||||
plot.hooks.draw.push(drawDone);
|
||||
plot.hooks.bindEvents.push(processbindEvents);
|
||||
plot.hooks.shutdown.push(shutdown);
|
||||
|
||||
|
||||
function processSeries(plot, canvascontext, series) {
|
||||
opt = plot.getOptions();
|
||||
var valueIndex = opt.series.grow.valueIndex;
|
||||
if (opt.series.grow.active === true) {
|
||||
var reanimate = false;
|
||||
var j = 0;
|
||||
|
||||
if (opt.series.grow.reanimate && growPhase === GrowPhase.PLOTTED_LAST_FRAME) {
|
||||
// reset animation state
|
||||
processSeriesDone = false;
|
||||
growPhase = GrowPhase.NOT_PLOTTED_YET;
|
||||
startTime = 0;
|
||||
|
||||
// restore old data from the tempory variable to the actual plot data
|
||||
data = plot.getData();
|
||||
var minLen = Math.min(data.length, dataOld.length);
|
||||
for (j = 0; j < minLen; j++) {
|
||||
data[j].dataOld = dataOld[j];
|
||||
}
|
||||
|
||||
reanimate = true;
|
||||
initGrowingLoop = true;
|
||||
}
|
||||
|
||||
if (!processSeriesDone) {
|
||||
// do not refetch the data in case of a reanimate,
|
||||
// so that a single setData is called
|
||||
if (!reanimate) {
|
||||
data = plot.getData();
|
||||
}
|
||||
|
||||
growPhase = GrowPhase.NOT_PLOTTED_YET;
|
||||
startTime = +new Date() | 0;
|
||||
dataOld = [];
|
||||
for (j = 0; j < data.length; j++) {
|
||||
var dataj = data[j];
|
||||
// deep cloning the original data
|
||||
dataj.dataOrg = $.extend(true, [], dataj.data);
|
||||
// keep the data in a temporary array, in case a reanimation is requested
|
||||
dataOld.push(dataj.dataOrg);
|
||||
|
||||
if (!reanimate) {
|
||||
// set zero or null initial data values.
|
||||
for (var i = 0; i < dataj.data.length; i++) {
|
||||
dataj.data[i][valueIndex] = dataj.dataOrg[i][valueIndex] === null ? null : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
plot.setData(data);
|
||||
processSeriesDone = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function drawDone(plot, canvascontext) {
|
||||
if (initGrowingLoop === true) {
|
||||
initiateGrowingLoop(plot);
|
||||
}
|
||||
}
|
||||
|
||||
function initiateGrowingLoop(plot) {
|
||||
opt = plot.getOptions();
|
||||
if (opt.series.grow.active === true) {
|
||||
calculateMaxDuration(plot.getData(), opt);
|
||||
|
||||
startTime = +new Date() | 0;
|
||||
growfunc = requestAnimationFrame(growingLoop);
|
||||
}
|
||||
initGrowingLoop = false;
|
||||
}
|
||||
|
||||
function calculateMaxDuration(data, opt) {
|
||||
var maxDuration = opt.series.grow.duration;
|
||||
for (var j = 0, datalen = data.length; j < datalen; j++) {
|
||||
var datajDuration = data[j].grow.duration;
|
||||
if (maxDuration < datajDuration) {
|
||||
maxDuration = datajDuration;
|
||||
}
|
||||
}
|
||||
opt.series.grow.duration = maxDuration;
|
||||
}
|
||||
|
||||
function processbindEvents(plot, eventHolder) {
|
||||
if (isPluginRegistered('resize')) {
|
||||
plot.getPlaceholder().resize(onResize);
|
||||
}
|
||||
}
|
||||
|
||||
function growingLoop() {
|
||||
timePassed = (+new Date()) - startTime | 0;
|
||||
for (var j = 0, datalen = data.length; j < datalen; j++) {
|
||||
var dataj = data[j];
|
||||
var isReAnimation = dataj.dataOld && dataj.dataOld.length > 0;
|
||||
|
||||
for (var g = 0, glen = dataj.grow.growings.length; g < glen; g++) {
|
||||
var growing = dataj.grow.growings[g];
|
||||
var func;
|
||||
|
||||
if (isReAnimation && growing.reanimate !== 'reinit') {
|
||||
if (typeof growing.reanimate === 'function') {
|
||||
func = growing.reanimate;
|
||||
} if (growing.reanimate === 'continue') {
|
||||
func = growFunctions.reanimate;
|
||||
} else {// if (growing.reanimate === 'none')
|
||||
func = growFunctions.none;
|
||||
}
|
||||
} else if (typeof growing.stepMode === 'function') {
|
||||
func = growing.stepMode;
|
||||
} else {
|
||||
// if stepMode does not exist, use 'none'
|
||||
func = growFunctions[growing.stepMode] || growFunctions.none;
|
||||
}
|
||||
func(dataj, timePassed, growing, growPhase);
|
||||
}
|
||||
}
|
||||
|
||||
plt.setData(data);
|
||||
plt.draw();
|
||||
|
||||
if (growPhase === GrowPhase.NOT_PLOTTED_YET) {
|
||||
growPhase = GrowPhase.PLOTTED_SOME_FRAMES;
|
||||
}
|
||||
|
||||
if (timePassed < opt.series.grow.duration) {
|
||||
growfunc = requestAnimationFrame(growingLoop);
|
||||
} else {
|
||||
growPhase = GrowPhase.PLOTTED_LAST_FRAME;
|
||||
growfunc = null;
|
||||
plt.getPlaceholder().trigger('growFinished');
|
||||
}
|
||||
}
|
||||
|
||||
function onResize() {
|
||||
if (growfunc) {
|
||||
for (var j = 0; j < data.length; j++) {
|
||||
var dataj = data[j];
|
||||
// deep cloning the original data
|
||||
dataj.data = $.extend(true, [], dataj.dataOrg);
|
||||
}
|
||||
plot.setData(data);
|
||||
plot.setupGrid();
|
||||
}
|
||||
}
|
||||
|
||||
function shutdown(plot, eventHolder) {
|
||||
plot.getPlaceholder().unbind('resize', onResize);
|
||||
if (growfunc) {
|
||||
cancelAnimationFrame(growfunc);
|
||||
growfunc = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isPluginRegistered(pluginName) {
|
||||
var plugins = $.plot.plugins;
|
||||
|
||||
for (var i = 0, len = plugins.length; i < len; i++) {
|
||||
var plug = plugins[i];
|
||||
|
||||
if (plug.name === pluginName) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Derived from:
|
||||
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
|
||||
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
|
||||
// requestAnimationFrame polyfill by Erik Möller
|
||||
// fixes from Paul Irish and Tino Zijdel
|
||||
function polyfillLocalRequestAnimationFrame() {
|
||||
var rAF = window.requestAnimationFrame;
|
||||
var cAF = window.cancelAnimationFrame;
|
||||
|
||||
var lastTime = +new Date();
|
||||
var vendors = ['ms', 'moz', 'webkit', 'o'];
|
||||
for(var x = 0; x < vendors.length && !rAF; ++x) {
|
||||
rAF = window[vendors[x]+'RequestAnimationFrame'];
|
||||
|
||||
cAF = window[vendors[x]+'CancelAnimationFrame'] ||
|
||||
window[vendors[x]+'CancelRequestAnimationFrame'];
|
||||
}
|
||||
if (!rAF) {
|
||||
rAF = function(callback, element) {
|
||||
var currTime = +new Date();
|
||||
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
|
||||
var id = window.setTimeout(function() {
|
||||
callback(currTime + timeToCall);
|
||||
}, timeToCall);
|
||||
lastTime = currTime + timeToCall;
|
||||
return id;
|
||||
};
|
||||
}
|
||||
if (!cAF) {
|
||||
cAF = function(id) {
|
||||
clearTimeout(id);
|
||||
};
|
||||
}
|
||||
requestAnimationFrame = rAF;
|
||||
cancelAnimationFrame = cAF;
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: pluginName,
|
||||
version: pluginVersion
|
||||
});
|
||||
})(jQuery);
|
|
@ -0,0 +1,241 @@
|
|||
/* Flot plugin for plotting images.
|
||||
|
||||
Copyright (c) 2007-2013 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The data syntax is [ [ image, x1, y1, x2, y2 ], ... ] where (x1, y1) and
|
||||
(x2, y2) are where you intend the two opposite corners of the image to end up
|
||||
in the plot. Image must be a fully loaded Javascript image (you can make one
|
||||
with new Image()). If the image is not complete, it's skipped when plotting.
|
||||
|
||||
There are two helpers included for retrieving images. The easiest work the way
|
||||
that you put in URLs instead of images in the data, like this:
|
||||
|
||||
[ "myimage.png", 0, 0, 10, 10 ]
|
||||
|
||||
Then call $.plot.image.loadData( data, options, callback ) where data and
|
||||
options are the same as you pass in to $.plot. This loads the images, replaces
|
||||
the URLs in the data with the corresponding images and calls "callback" when
|
||||
all images are loaded (or failed loading). In the callback, you can then call
|
||||
$.plot with the data set. See the included example.
|
||||
|
||||
A more low-level helper, $.plot.image.load(urls, callback) is also included.
|
||||
Given a list of URLs, it calls callback with an object mapping from URL to
|
||||
Image object when all images are loaded or have failed loading.
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
series: {
|
||||
images: {
|
||||
show: boolean
|
||||
anchor: "corner" or "center"
|
||||
alpha: [ 0, 1 ]
|
||||
}
|
||||
}
|
||||
|
||||
They can be specified for a specific series:
|
||||
|
||||
$.plot( $("#placeholder"), [{
|
||||
data: [ ... ],
|
||||
images: { ... }
|
||||
])
|
||||
|
||||
Note that because the data format is different from usual data points, you
|
||||
can't use images with anything else in a specific data series.
|
||||
|
||||
Setting "anchor" to "center" causes the pixels in the image to be anchored at
|
||||
the corner pixel centers inside of at the pixel corners, effectively letting
|
||||
half a pixel stick out to each side in the plot.
|
||||
|
||||
A possible future direction could be support for tiling for large images (like
|
||||
Google Maps).
|
||||
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
series: {
|
||||
images: {
|
||||
show: false,
|
||||
alpha: 1,
|
||||
anchor: "corner" // or "center"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.plot.image = {};
|
||||
|
||||
$.plot.image.loadDataImages = function (series, options, callback) {
|
||||
var urls = [], points = [];
|
||||
|
||||
var defaultShow = options.series.images.show;
|
||||
|
||||
$.each(series, function (i, s) {
|
||||
if (!(defaultShow || s.images.show))
|
||||
return;
|
||||
|
||||
if (s.data)
|
||||
s = s.data;
|
||||
|
||||
$.each(s, function (i, p) {
|
||||
if (typeof p[0] == "string") {
|
||||
urls.push(p[0]);
|
||||
points.push(p);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$.plot.image.load(urls, function (loadedImages) {
|
||||
$.each(points, function (i, p) {
|
||||
var url = p[0];
|
||||
if (loadedImages[url])
|
||||
p[0] = loadedImages[url];
|
||||
});
|
||||
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
$.plot.image.load = function (urls, callback) {
|
||||
var missing = urls.length, loaded = {};
|
||||
if (missing == 0)
|
||||
callback({});
|
||||
|
||||
$.each(urls, function (i, url) {
|
||||
var handler = function () {
|
||||
--missing;
|
||||
|
||||
loaded[url] = this;
|
||||
|
||||
if (missing == 0)
|
||||
callback(loaded);
|
||||
};
|
||||
|
||||
$('<img />').load(handler).error(handler).attr('src', url);
|
||||
});
|
||||
};
|
||||
|
||||
function drawSeries(plot, ctx, series) {
|
||||
var plotOffset = plot.getPlotOffset();
|
||||
|
||||
if (!series.images || !series.images.show)
|
||||
return;
|
||||
|
||||
var points = series.datapoints.points,
|
||||
ps = series.datapoints.pointsize;
|
||||
|
||||
for (var i = 0; i < points.length; i += ps) {
|
||||
var img = points[i],
|
||||
x1 = points[i + 1], y1 = points[i + 2],
|
||||
x2 = points[i + 3], y2 = points[i + 4],
|
||||
xaxis = series.xaxis, yaxis = series.yaxis,
|
||||
tmp;
|
||||
|
||||
// actually we should check img.complete, but it
|
||||
// appears to be a somewhat unreliable indicator in
|
||||
// IE6 (false even after load event)
|
||||
if (!img || img.width <= 0 || img.height <= 0)
|
||||
continue;
|
||||
|
||||
if (x1 > x2) {
|
||||
tmp = x2;
|
||||
x2 = x1;
|
||||
x1 = tmp;
|
||||
}
|
||||
if (y1 > y2) {
|
||||
tmp = y2;
|
||||
y2 = y1;
|
||||
y1 = tmp;
|
||||
}
|
||||
|
||||
// if the anchor is at the center of the pixel, expand the
|
||||
// image by 1/2 pixel in each direction
|
||||
if (series.images.anchor == "center") {
|
||||
tmp = 0.5 * (x2-x1) / (img.width - 1);
|
||||
x1 -= tmp;
|
||||
x2 += tmp;
|
||||
tmp = 0.5 * (y2-y1) / (img.height - 1);
|
||||
y1 -= tmp;
|
||||
y2 += tmp;
|
||||
}
|
||||
|
||||
// clip
|
||||
if (x1 == x2 || y1 == y2 ||
|
||||
x1 >= xaxis.max || x2 <= xaxis.min ||
|
||||
y1 >= yaxis.max || y2 <= yaxis.min)
|
||||
continue;
|
||||
|
||||
var sx1 = 0, sy1 = 0, sx2 = img.width, sy2 = img.height;
|
||||
if (x1 < xaxis.min) {
|
||||
sx1 += (sx2 - sx1) * (xaxis.min - x1) / (x2 - x1);
|
||||
x1 = xaxis.min;
|
||||
}
|
||||
|
||||
if (x2 > xaxis.max) {
|
||||
sx2 += (sx2 - sx1) * (xaxis.max - x2) / (x2 - x1);
|
||||
x2 = xaxis.max;
|
||||
}
|
||||
|
||||
if (y1 < yaxis.min) {
|
||||
sy2 += (sy1 - sy2) * (yaxis.min - y1) / (y2 - y1);
|
||||
y1 = yaxis.min;
|
||||
}
|
||||
|
||||
if (y2 > yaxis.max) {
|
||||
sy1 += (sy1 - sy2) * (yaxis.max - y2) / (y2 - y1);
|
||||
y2 = yaxis.max;
|
||||
}
|
||||
|
||||
x1 = xaxis.p2c(x1);
|
||||
x2 = xaxis.p2c(x2);
|
||||
y1 = yaxis.p2c(y1);
|
||||
y2 = yaxis.p2c(y2);
|
||||
|
||||
// the transformation may have swapped us
|
||||
if (x1 > x2) {
|
||||
tmp = x2;
|
||||
x2 = x1;
|
||||
x1 = tmp;
|
||||
}
|
||||
if (y1 > y2) {
|
||||
tmp = y2;
|
||||
y2 = y1;
|
||||
y1 = tmp;
|
||||
}
|
||||
|
||||
tmp = ctx.globalAlpha;
|
||||
ctx.globalAlpha *= series.images.alpha;
|
||||
ctx.drawImage(img,
|
||||
sx1, sy1, sx2 - sx1, sy2 - sy1,
|
||||
x1 + plotOffset.left, y1 + plotOffset.top,
|
||||
x2 - x1, y2 - y1);
|
||||
ctx.globalAlpha = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
function processRawData(plot, series, data, datapoints) {
|
||||
if (!series.images.show)
|
||||
return;
|
||||
|
||||
// format is Image, x1, y1, x2, y2 (opposite corners)
|
||||
datapoints.format = [
|
||||
{ required: true },
|
||||
{ x: true, number: true, required: true },
|
||||
{ y: true, number: true, required: true },
|
||||
{ x: true, number: true, required: true },
|
||||
{ y: true, number: true, required: true }
|
||||
];
|
||||
}
|
||||
|
||||
function init(plot) {
|
||||
plot.hooks.processRawData.push(processRawData);
|
||||
plot.hooks.drawSeries.push(drawSeries);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'image',
|
||||
version: '1.1'
|
||||
});
|
||||
})(jQuery);
|
|
@ -0,0 +1,53 @@
|
|||
/* Flot plugin for plotting images.
|
||||
|
||||
Copyright (c) 2007-2013 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The data syntax is [ [ image, x1, y1, x2, y2 ], ... ] where (x1, y1) and
|
||||
(x2, y2) are where you intend the two opposite corners of the image to end up
|
||||
in the plot. Image must be a fully loaded Javascript image (you can make one
|
||||
with new Image()). If the image is not complete, it's skipped when plotting.
|
||||
|
||||
There are two helpers included for retrieving images. The easiest work the way
|
||||
that you put in URLs instead of images in the data, like this:
|
||||
|
||||
[ "myimage.png", 0, 0, 10, 10 ]
|
||||
|
||||
Then call $.plot.image.loadData( data, options, callback ) where data and
|
||||
options are the same as you pass in to $.plot. This loads the images, replaces
|
||||
the URLs in the data with the corresponding images and calls "callback" when
|
||||
all images are loaded (or failed loading). In the callback, you can then call
|
||||
$.plot with the data set. See the included example.
|
||||
|
||||
A more low-level helper, $.plot.image.load(urls, callback) is also included.
|
||||
Given a list of URLs, it calls callback with an object mapping from URL to
|
||||
Image object when all images are loaded or have failed loading.
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
series: {
|
||||
images: {
|
||||
show: boolean
|
||||
anchor: "corner" or "center"
|
||||
alpha: [ 0, 1 ]
|
||||
}
|
||||
}
|
||||
|
||||
They can be specified for a specific series:
|
||||
|
||||
$.plot( $("#placeholder"), [{
|
||||
data: [ ... ],
|
||||
images: { ... }
|
||||
])
|
||||
|
||||
Note that because the data format is different from usual data points, you
|
||||
can't use images with anything else in a specific data series.
|
||||
|
||||
Setting "anchor" to "center" causes the pixels in the image to be anchored at
|
||||
the corner pixel centers inside of at the pixel corners, effectively letting
|
||||
half a pixel stick out to each side in the plot.
|
||||
|
||||
A possible future direction could be support for tiling for large images (like
|
||||
Google Maps).
|
||||
|
||||
*/(function(e){function n(e,t,n){var r=e.getPlotOffset();if(!n.images||!n.images.show)return;var i=n.datapoints.points,s=n.datapoints.pointsize;for(var o=0;o<i.length;o+=s){var u=i[o],a=i[o+1],f=i[o+2],l=i[o+3],c=i[o+4],h=n.xaxis,p=n.yaxis,d;if(!u||u.width<=0||u.height<=0)continue;a>l&&(d=l,l=a,a=d),f>c&&(d=c,c=f,f=d),n.images.anchor=="center"&&(d=.5*(l-a)/(u.width-1),a-=d,l+=d,d=.5*(c-f)/(u.height-1),f-=d,c+=d);if(a==l||f==c||a>=h.max||l<=h.min||f>=p.max||c<=p.min)continue;var v=0,m=0,g=u.width,y=u.height;a<h.min&&(v+=(g-v)*(h.min-a)/(l-a),a=h.min),l>h.max&&(g+=(g-v)*(h.max-l)/(l-a),l=h.max),f<p.min&&(y+=(m-y)*(p.min-f)/(c-f),f=p.min),c>p.max&&(m+=(m-y)*(p.max-c)/(c-f),c=p.max),a=h.p2c(a),l=h.p2c(l),f=p.p2c(f),c=p.p2c(c),a>l&&(d=l,l=a,a=d),f>c&&(d=c,c=f,f=d),d=t.globalAlpha,t.globalAlpha*=n.images.alpha,t.drawImage(u,v,m,g-v,y-m,a+r.left,f+r.top,l-a,c-f),t.globalAlpha=d}}function r(e,t,n,r){if(!t.images.show)return;r.format=[{required:!0},{x:!0,number:!0,required:!0},{y:!0,number:!0,required:!0},{x:!0,number:!0,required:!0},{y:!0,number:!0,required:!0}]}function i(e){e.hooks.processRawData.push(r),e.hooks.drawSeries.push(n)}var t={series:{images:{show:!1,alpha:1,anchor:"corner"}}};e.plot.image={},e.plot.image.loadDataImages=function(t,n,r){var i=[],s=[],o=n.series.images.show;e.each(t,function(t,n){if(!o&&!n.images.show)return;n.data&&(n=n.data),e.each(n,function(e,t){typeof t[0]=="string"&&(i.push(t[0]),s.push(t))})}),e.plot.image.load(i,function(t){e.each(s,function(e,n){var r=n[0];t[r]&&(n[0]=t[r])}),r()})},e.plot.image.load=function(t,n){var r=t.length,i={};r==0&&n({}),e.each(t,function(t,s){var o=function(){--r,i[s]=this,r==0&&n(i)};e("<img />").load(o).error(o).attr("src",s)})},e.plot.plugins.push({init:i,options:t,name:"image",version:"1.1"})})(jQuery);
|