Comments (9)
I just came here to report this.
from atom-julia-client.
That behavior makes sense -- we should probably truncate the displayed output after some sensible threshold (just like Julia's REPL). That shouldn't be much of a problem, since no one would really want to scroll through 100,000 elements, right? :-)
from atom-julia-client.
Yup, the problem here is that Julia tries to display every element of the vector which crashes Atom (possibly just because it takes so long to transfer the result over TCP). In future I'd really like to have a tree-like display for large results, e.g. something like:
v Vector Int, 100
v 1 - 10
1
4
6
...
> 11 - 20
> 21 – 30
...
However, that needs lazy-loading to work really well. A reasonable stopgap would be to just cut out the middle elements, as Juno/LT and the repl do currently.
from atom-julia-client.
I was actually going to do just this (the stopgap measure), but then I realised that my CoffeeScript knowledge is so woefully inadequate that I couldn't even locate the part of the code I'd have to change...
from atom-julia-client.
Fortunately, you wouldn't have to touch CoffeeScript at all – the tree views are all created in Julia, here, and then sent to the frontend to be rendered. It's as simple as cutting out some of the children if there are too many.
In general, if you're interested in patching anything but not sure where to start, feel free to let me know and I'll try to give pointers. I should probably write up some more devdocs on how display works so that it's a bit easier to get into.
from atom-julia-client.
Okay, I don't really understand what's going on here, which is why I won't submit a PR (where is render
defined? And how does it differ from the macro @render
? Where is the Inline
type defined?), but a working version of what I'd like to see would be:
@render i::Inline xs::Vector begin
if length(xs) <= 25
Tree(span(strong("Vector"),
fade(" $(eltype(xs)), $(length(xs))")),
[render(i, x, options = options) for x in xs])
else
Tree(span(strong("Vector"),
fade(" $(eltype(xs)), $(length(xs))")),
[[render(i, x, options = options) for x in xs[1:10]];
"...";
[render(i, x, options = options) for x in xs[end-9:end]]])
end
end
(actually I'll keep that around in my version of the Atom.jl package for now, given that it saves me a lot of grievances over accidentally eval'ing some expression that returns a 100000+ vector :))
from atom-julia-client.
I'd be happy to take that as a PR, perhaps with just a little refactoring to avoid the repetition.
I'll also write up a bit more about how display is working and point you to it when I get the chance.
from atom-julia-client.
Okay, not sure my refactoring is what you were looking for, but I've created a PR.
from atom-julia-client.
The original issue is fixed so I'm re-purposing this for the tree views thing I mentioned above.
from atom-julia-client.
Related Issues (20)
- julia-client HOT 2
- Uncaught TypeError: log is not a function
- Uncaught TypeError: log is not a function HOT 1
- Uncaught TypeError: path.dirname is not a function
- Uncaught TypeError: log is not a function
- Uncaught TypeError: Cannot read property 'on' of undefined HOT 1
- julia-client 0.12.6 under Windows: Cannot resolve directory path of julia.exe
- Uncaught TypeError: log is not a function
- Uncaught TypeError: shell.openItem is not a function
- node-pty-prebuilt needs a bump to 0.10 HOT 3
- Uncaught TypeError: Cannot read property 'dirname' of null
- Uncaught Error: Cannot find module '../runtime'Require stack:- $ATOM_HOME/packages\julia-client...
- Uncaught TypeError: log is not a function
- Uncaught TypeError: log is not a function HOT 2
- Uncaught TypeError: log is not a function
- Installing “[email protected]” failed HOT 8
- Error to start Julia in Atom with Julia Client package installed
- julia-client package HOT 3
- Not able to install
- MS Store Juliaup installer - "Couldn't resolve version." error. (Atom julia-client)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atom-julia-client.