diff --git a/README.md b/README.md index 9cd9a62..7e349d3 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,10 @@ app.py ----服务器的主程序 ## 更新日志 +* 2021年2月8号,前端更新 + + * 新增在弹出窗口里嵌入bokehjs代码的功能 + *  * 2021年2月8号,前端更新,后端更新 * 优化了mos器件的描述方法 @@ -90,7 +94,7 @@ app.py ----服务器的主程序 * 增加了按下delete键删除元素的功能 * 发现了一些bug,例如当进行FlipH和FlipV时端口无法跟着进行翻转 * 当前的功能界面如下图所示 - *  + *  * 2021年1月28日,前端更新 * 增加了一些功能控件,完成基本雏形 diff --git a/doc/schematic.png b/doc/schematic1.png similarity index 100% rename from doc/schematic.png rename to doc/schematic1.png diff --git a/doc/schematic5.png b/doc/schematic5.png new file mode 100644 index 0000000..59a6f20 Binary files /dev/null and b/doc/schematic5.png differ diff --git a/static/spice/bokeh_01.js b/static/spice/bokeh_01.js new file mode 100644 index 0000000..fc9929c --- /dev/null +++ b/static/spice/bokeh_01.js @@ -0,0 +1,43 @@ + +// create a data source to hold data +var source = new Bokeh.ColumnDataSource({ + data: { x: [], y: [] } +}); + +// make a plot with some tools +var plot = Bokeh.Plotting.figure({ + title:'Example of Random data', + tools: "pan,wheel_zoom,box_zoom,reset,save", + height: 300, + width: 300 +}); + +// add a line with data from the source +plot.line({ field: "x" }, { field: "y" }, { + source: source, + line_width: 2 +}); + +// show the plot, appending it to the end of the current section +Bokeh.Plotting.show(plot,'#bokeh_01'); + +function addPoint() { + // add data --- all fields must be the same length. + source.data.x.push(Math.random()) + source.data.y.push(Math.random()) + + // notify the DataSource of "in-place" changes + source.change.emit() +} + +function Callback_Button() { + addPoint(); +} + +var addDataButton = document.createElement("Button"); +addDataButton.appendChild(document.createTextNode("Add Some Data!!!")); +document.currentScript.parentElement.appendChild(addDataButton); +addDataButton.addEventListener("click", Callback_Button); + +addPoint(); +addPoint(); diff --git a/template/schematic/schematic.html b/template/schematic/schematic.html index 0e1a0e1..5c3a3bc 100644 --- a/template/schematic/schematic.html +++ b/template/schematic/schematic.html @@ -1,12 +1,11 @@
-