JuliaGizmos / WebIO.jl

A bridge between Julia and the Web.
https://juliagizmos.github.io/WebIO.jl/latest/
Other
228 stars 64 forks source link

About WebIO Is there somebody can help me? #429

Open Heisenburger2020 opened 4 years ago

Heisenburger2020 commented 4 years ago

When I want to simulate random walk with julia . @manipulate for T in 10:100 plot(0:T, walk(T)) end

However, I got this:

Node{WebIO.DOM}(WebIO.DOM(:html, :div), Any[Node{WebIO.DOM}(WebIO.DOM(:html, :div), Any[Scope(Node{WebIO.DOM}(WebIO.DOM(:html, :div), Any[Node{WebIO.DOM}(WebIO.DOM(:html, :div), Any[Node{WebIO.DOM}(WebIO.DOM(:html, :label), Any["T"], Dict{Symbol,Any}(:className => "interact ",:style => Dict{Any,Any}(:padding => "5px 10px 0px 10px")))], Dict{Symbol,Any}(:className => "interact-flex-row-left")), Node{WebIO.DOM}(WebIO.DOM(:html, :div), Any[Node{WebIO.DOM}(WebIO.DOM(:html, :input), Any[], Dict{Symbol,Any}(:max => 100,:min => 10,:attributes => Dict{Any,Any}(:type => "range",Symbol("data-bind") => "numericValue: index, valueUpdate: 'input', event: {change: function (){this.changes(this.changes()+1)}}","orient" => "horizontal"),:step => 1,:className => "slider slider is-fullwidth",:style => Dict{Any,Any}()))], Dict{Symbol,Any}(:className => "interact-flex-row-center")), Node{WebIO.DOM}(WebIO.DOM(:html, :div), Any[Node{WebIO.DOM}(WebIO.DOM(:html, :p), Any[], Dict{Symbol,Any}(:attributes => Dict("data-bind" => "text: formatted_val")))], Dict{Symbol,Any}(:className => "interact-flex-row-right"))], Dict{Symbol,Any}(:className => "interact-flex-row interact-widget")), Dict{String,Tuple{Observables.AbstractObservable,Union{Nothing, Bool}}}("changes" => (Observable{Int64} with 1 listeners. Value: 0, nothing),"index" => (Observable{Int64} with 2 listeners. Value: 55, nothing)), Set{String}(), nothing, Asset[Asset("js", "knockout", "C:\Users\86186\.julia\packages\Knockout\IP1uR\src\..\assets\knockout.js"), Asset("js", "knockout_punches", "C:\Users\86186\.julia\packages\Knockout\IP1uR\src\..\assets\knockout_punches.js"), Asset("js", nothing, "C:\Users\86186\.julia\packages\InteractBase\sOe2Z\src\..\assets\all.js"), Asset("css", nothing, "C:\Users\86186\.julia\packages\InteractBase\sOe2Z\src\..\assets\style.css"), Asset("css", nothing, "C:\Users\86186\.julia\packages\Interact\SbgIk\src\..\assets\bulma_confined.min.css")], Dict{Any,Any}("changes" => Any[WebIO.JSString("(function (val){return (val!=this.model[\"changes\"]()) ? (this.valueFromJulia[\"changes\"]=true, this.model\"changes\") : undefined})")],"index" => Any[WebIO.JSString("(function (val){return (val!=this.model[\"index\"]()) ? (this.valueFromJulia[\"index\"]=true, this.model\"index\") : undefined})")]), WebIO.ConnectionPool(Channel{Any}(sz_max:32,sz_curr:0), Set{AbstractConnection}(), Base.GenericCondition{Base.AlwaysLockedST}(Base.InvasiveLinkedList{Task}(Task (runnable) @0x0000000014482570, Task (runnable) @0x0000000014482570), Base.AlwaysLockedST(1))), WebIO.JSString[WebIO.JSString("function () {\n var handler = (function (ko, koPunches) {\n ko.punches.enableAll();\n ko.bindingHandlers.numericValue = {\n init: function(element, valueAccessor, allBindings, data, context) {\n var stringified = ko.observable(ko.unwrap(valueAccessor()));\n stringified.subscribe(function(value) {\n var val = parseFloat(value);\n if (!isNaN(val)) {\n valueAccessor()(val);\n }\n });\n valueAccessor().subscribe(function(value) {\n var str = JSON.stringify(value);\n if ((str == \"0\") && ([\"-0\", \"-0.\"].indexOf(stringified()) >= 0))\n return;\n if ([\"null\", \"\"].indexOf(str) >= 0)\n return;\n stringified(str);\n });\n ko.applyBindingsToNode(\n element,\n {\n value: stringified,\n valueUpdate: allBindings.get('valueUpdate'),\n },\n context,\n );\n }\n };\n var json_data = {\"formatted_vals\":[\"10\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\",\"17\",\"18\",\"19\",\"20\",\"21\",\"22\",\"23\",\"24\",\"25\",\"26\",\"27\",\"28\",\"29\",\"30\",\"31\",\"32\",\"33\",\"34\",\"35\",\"36\",\"37\",\"38\",\"39\",\"40\",\"41\",\"42\",\"43\",\"44\",\"45\",\"46\",\"47\",\"48\",\"49\",\"50\",\"51\",\"52\",\"53\",\"54\",\"55\",\"56\",\"57\",\"58\",\"59\",\"60\",\"61\",\"62\",\"63\",\"64\",\"65\",\"66\",\"67\",\"68\",\"69\",\"70\",\"71\",\"72\",\"73\",\"74\",\"75\",\"76\",\"77\",\"78\",\"79\",\"80\",\"81\",\"82\",\"83\",\"84\",\"85\",\"86\",\"87\",\"88\",\"89\",\"90\",\"91\",\"92\",\"93\",\"94\",\"95\",\"96\",\"97\",\"98\",\"99\",\"100\"],\"changes\":WebIO.getval({\"name\":\"changes\",\"scope\":\"17029633791708198003\",\"id\":\"10624212001861622628\",\"type\":\"observable\"}),\"index\":WebIO.getval({\"name\":\"index\",\"scope\":\"17029633791708198003\",\"id\":\"5816724984880962260\",\"type\":\"observable\"})};\n var self = this;\n function AppViewModel() {\n for (var key in json_data) {\n var el = json_data[key];\n this[key] = Array.isArray(el) ? ko.observableArray(el) : ko.observable(el);\n }\n \n [this[\"formatted_val\"]=ko.computed( function(){\n return this.formatted_vals()[parseInt(this.index())-(10)];\n }\n,this)]\n [this[\"changes\"].subscribe((function (val){!(this.valueFromJulia[\"changes\"]) ? (WebIO.setval({\"name\":\"changes\",\"scope\":\"17029633791708198003\",\"id\":\"10624212001861622628\",\"type\":\"observable\"},val)) : undefined; return this.valueFromJulia[\"changes\"]=false}),self),this[\"index\"].subscribe((function (val){!(this.valueFromJulia[\"index\"]) ? (WebIO.setval({\"name\":\"index\",\"scope\":\"17029633791708198003\",\"id\":\"5816724984880962260\",\"type\":\"observable\"},val)) : undefined; return this.valueFromJulia[\"index\"]=false}),self)]\n \n }\n self.model = new AppViewModel();\n self.valueFromJulia = {};\n for (var key in json_data) {\n self.valueFromJulia[key] = false;\n }\n ko.applyBindings(self.model, self.dom);\n}\n);\n (WebIO.importBlock({\"data\":[{\"name\":\"knockout\",\"type\":\"js\",\"url\":\"/assetserver/ce3959e627bf0e4f3240106ea13301477c09a407-knockout.js\"},{\"name\":\"knockout_punches\",\"type\":\"js\",\"url\":\"/assetserver/198345fb6be6f1bc9eba0fa01ba58b2796739d0f-knockout_punches.js\"}],\"type\":\"async_block\"})).then((imports) => handler.apply(this, imports));\n}\n")])], Dict{Symbol,Any}(:className => "field interact-widget")), Observable{Any} with 0 listeners. Value: Node{WebIO.DOM}(WebIO.DOM(:html, :div), Any[GR.SVG(UInt8[0x3c, 0x3f, 0x78, 0x6d, 0x6c, 0x20, 0x76, 0x65, 0x72, 0x73 … 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x73, 0x76, 0x67, 0x3e, 0x0a])], Dict{Symbol,Any}(:className => "interact-flex-row interact-widget"))], Dict{Symbol,Any}())

GerritGue commented 4 years ago

I have the same problem. I am using Julia 1.5.2 on win10 with the newest versions of Interact, WebIO. The problem occurs when I am using JupyterLab, Juno or Pluto. Couldnt find a solution yet

yanyu2015 commented 2 years ago

I have the same problem. julia version 1.7

fengxu47 commented 2 years ago

I have the same problem. Did somebody solve it?

Heyuchen-330 commented 2 years ago

same problem, any solution?

Kollanda commented 2 years ago

(https://discourse.julialang.org/t/problem-with-curl-exe-windows-and-package-installation/29525/53):

  1. Open your windows command prompt, and type echo %APPDATA% to get the personal app data folder.

  2. Create an empty file called _curlrc in the app data folder (you can use any text editor - a standard .txt with notepad will work).

  3. Write insecure on that file and save.

  4. Start Julia

  5. import Pkg; Pkg.build("Interact")

  6. Run Jupyter and interact should work

Boylad commented 1 year ago

很有可能是防火墙的问题。对我而言是build("InteractBase")发生了错误: image image 虽然我能够在Chrome中打开cdn.jsdelivr.net但是,在Cmdping cdn.jsdelivr.net时,不通。当我ping cdn.jsdelivr.net可以收到响应后再Pkg.build("InteractBase"),就没有任何问题了。 image image