Closed asukaminato0721 closed 9 months ago
It looks great, thanks for adding this feature.
But I do see some small problems in this implementation:
handleMainLink
. I would suggest putting it in handleOutput
, e.g. here. ToBoxes
followed by FreeQ
is used to detect when Wolfram Player is needed, but it can cause problems when the expression within the packet should not be evaluated. Instead, you may be able to make use of this boxes
variable to do the check. DynamicBox
may interact with variables that are outside the box. Is there a way to detect this? You can then notify the user by rendering an error message.In terms of the TODOs, here are some potential solutions:
$CommandLine
.Run
blocks the main link queue or the output queue. You can try wrapping it with LocalSubmit
to run asynchronously.Progress
- [x] Right now, Run blocks the main link queue or the output queue. You can try wrapping it with LocalSubmit to run asynchronously.
still meet zmq problem.
{A,B,C}=ReIm@Table[(Sqrt[2] (a^2 b^2 E^(-3 I t) (-1+4 E^(2/3 I (k \[Pi]+6 t)))+a^4 Cos[3 t]-I b^4 Sin[3 t]))/Sqrt[(a^2+b^2) (a^4+14 a^2 b^2+b^4)+(a^2-b^2)^3 Cos[6 t]],{k,0,2}];
M=(A+B+C)/3;
Manipulate[Block[{a=3,b=2,t=$t},Graphics[{{Circle[{0,0},{a,b}]},{Green,Line[{A,B,C,A}]},{Red,Line@Table[M,{t,0.,$t,2Pi/1000}],Disk[M,0.1]}},PlotRange->1.2Max[a,b]]],{$t,0.,2Pi}]
this code has some problem. Didn't figure out why.
I use the $InstallationDirectory
Currently I only set a boolean value.
(e.g. in a remote development environment, running wolframplayer probably does not make sense). If your decision is contrary to the user's choice, send a notification to the user so that they will not be surprised.
I tend to let user decide that, it's too complex to enumerate all situations.
fix https://github.com/njpipeorgan/wolfram-language-notebook/issues/40
This is a prototype, still has some problems. But it works well now.
Player is distributed with Engine, so it's ok to use it.
Some remaining TODOs:
set the wolfram player path in config. (Didn't figure out how to do it). Currently I hard coded it.
if using
StartProcess
, when close the player window, it willI don't know how to fix it, so I use
Run
, butRun
will stuck the notebook, so I add&
to avoid it. (But I don't know whether it's ok on windows).And I don't know use which,
RunProcess
orRun
orStartProcess
or may something else? So I useRun
since it's available fromv1.0
, and here stringjoin is safe.rename the function/varible name if needed.
ref https://gitee.com/asdasd1dsadsa/ZhiHu-asdasd1dsadsa/blob/master/Article/在WolframEngine中用WolframPlayer显示图像和动态内容.md