noprompt / ankha Goto Github PK
View Code? Open in Web Editor NEWA data inspection component for Om
License: Eclipse Public License 1.0
A data inspection component for Om
License: Eclipse Public License 1.0
It hit me last night that what's missing from EDN renderers is Differences! That's what we are looking for right? Differences is something we as ClojureScript developers should be able to do very well.
As an Atom changes we could render in the traditional red - green pattern:
Red for subtractions.
Green for additions.
For in-place changes we could provide a hover or a link that shows the previous value.
The renderer could have a checkbox that turns difference rendering on and off.
What do ya think?
Aside: Also the reason I am using my own renderer in Devcards (I wrote it before I knew about Ankha) is that I wanted it to work well inside and outside of Om. I'm still struggling to make things that work well on both. Using React as the base I get both platforms. This could be a misunderstanding on my part.
The error I get is:
Uncaught TypeError: Cannot call method 'call' of undefined
main.js [4101] collection
main.js [4104] inspect
main.js [4133] ankha.core.t13840.om$core$IRender$render$arity$1
main.js [3813] render
main.js [3879] anonymous
react.js [6029] anonymous
react.js [11403] anonymous
react.js [5582] anonymous
If a user double clicks on an element in a collection they should be able to edit just that value. This will clear the way for type-specific editors.
I'm not sure why, but according to Clojars and my dev environment, ankha 0.1.5.1-64423e
depends on com.cemerick/austin 0.1.3
. That's odd, because I don't see that reflected in the ankha
project.clj
.
austin
is listed as a :plugin
under the :dev
profile. Could that be propagating to the jar? Is this a Leiningen bug?
Hi,
Thanks for the component. I was wondering if it can be tweaked to be used as a chrome/firefox plugin like JsonView. This will allow me to hit my end points returning edn data, and view them in the browser directly.
Thanks,
Murtaza
I just get Chrome's "Something went wrong" page when I try to use the example from the README. In Safari I get "RangeError: Maximum call stack size exceeded." Tried on both Om 0.3.0 and 0.5.0, CLJS 0.0-2138.
I fired up the test example and was delighted by the neatness of this library. Unfortunately I tried to include it in a scaffolded tenzing app but it broke. Why hasn't it been updated in almost two years? Has it been replaced by some better way of doing it?
Just a thought, but I think it's doable.
Then I can listen on the channel and edit different pieces of the app-state (especially with my draggable window and jump-to-tree-path keybindings) instantly.
First of all thanks for your work! Really helpful.
I have a small request, would be great to add an option to the inspector component to start closed or opened.
The use case: normally I hang ankha inspector from my root app, and inspect the whole app state, but I want to see it closed all the time and open it the inspector on demand.
I tried using a custom renderer for Person records in the example included with ankha. I added the following code into the example (adapted from the readme):
(extend-protocol ankha/IInspect
Person
(-inspect [this]
(dom/span #js {:className "record user"}
(dom/span nil "First name: " (:first-name this))
" "
(dom/span nil "Last name: " (:last-name this)))))
However, this custom inspector doesn't get used. Instead, the one associated with the MapCursor
is used.
To trigger the Person renderer, I had to modify the example to unwrap the cursor with om/vaule
and then pass that to the inspector. But then the data is no longer editable.
Am I approaching this the wrong way or is there an ankha bug here?
Om only supports associative datastructures in its atom - don't let users insert anything that is not associative
From: https://groups.google.com/forum/#!topic/clojurescript/6B68zEij6Bg
One small thing is that the default size of the -/+ toggle buttons is really tiny, making it tough to press them (And their style is hard to override, since they have a lot of inline styling applied via the library) Maybe replace them with "[-]" and "[+]" for more clickable area.
One more suggestion: It would be cool if clicking on an entire item could collapse/expand it, not just the +/- symbols. Then the size of the +/- would no longer be an issue.
Theoretically it should work because it's referring to a type that is defined in the example
namespace but the reader can't seem to find that type. Need to investigate this - it would be nice if it just worked.
WARNING: record? already refers to: cljs.core/record? being replaced by: ankha.core/record? at line 29 file:/Users/brucehauman/.m2/repository/ankha/ankha/0.1.4/ankha-0.1.4.jar!/ankha/core.cljs
I would like to show just a subset (like with get-in) of an atom, that is editable, is that possible?
This library is cool but introduces a bunch of global classes and styles on textareas. Might be more suited for trying out inline styles or namespaced css.
Also is there an option for having all or some leaves toggled visible by default?
Hi, many thanks for this great peace of code.
Would you consider adding an option to have the tree closed by default? So the user would only see the top level keys of the state. And he/she could drill down manually for a specific key. I'm asking because my state have grown a lot and actually when I try to inspect it my Chrome crashes ;/
Right now the editor ignores everything but the first form in an editing box when it saves, which is probably surprising. This should maybe raise an error? Alternatively we could implement undo functionality so that the user can recover from this surprise. Also open to other ideas
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.