Giter Site home page Giter Site logo

proto-repl-charts's Introduction

proto-repl-charts package

API Docs

Proto REPL Charts is an Atom plugin that extends Proto REPL and allows you to display tables and graphs of results from executed Clojure Code.

Execute this in Proto REPL:

(proto-repl-charts.charts/line-chart
 "Trigonometry"
 {"sin" (map #(Math/sin %) (range 0.0 6.0 0.2))
  "cos" (map #(Math/cos %) (range 0.0 6.0 0.2))})

... and display this:

A screenshot of Proto REPL Charts showing a graph with sine and cosine

Installation

  1. Install Proto REPL.
  2. apm install proto-repl-charts or go to your Atom settings, select "+ Install" and search for "proto-repl-charts".

Usage

Proto REPL Charts are invoked from Clojure code run in Proto REPL. A very small Clojure library, proto-repl-charts, defines a namespace prc with functions for displaying different charts.

1. Add proto-repl-charts as a dependency in your Clojure project.

(Not necessary for self hosted REPL. The dependency is already available.)

Add Clojars Project to your dependencies in your project.clj file.

(Proto REPL comes with a default Clojure project. If you bring open a new Atom window for and start a REPL it will already have proto-repl-charts dependency loaded and available.)

2. Start the REPL in Proto REPL and wait for it to come up.

3. Execute one of the functions in the proto-repl-charts.<chart-type-ns> namespace. See the examples below.

The chart functions are all of the form (proto-repl-charts.<chart-type-ns>/<function-name> <tab-name> <series-map> <[options]>)

  • chart-type-ns - one of canvas, charts, graph, or table
  • function-name - the name of the function to invoke
  • tab-name - is the name of the chart to put in the Atom tab. Repeated execution will replace the chart in the tab with the matching name.
  • series-map - should be a map of series names to a sequence of values for that series. For example {"alpha" [1 2 3], "beta" [2 4 5]} would display two series named alpha and beta with the values 1, 2, and 3 for alpha and 2, 4, and 5 for beta.
  • options - an optional map of display options. The only option supported right now is :labels which is a list of labels. The index of the label in the list corresponds to the index of the values in the series.

Displaying a Line Chart

(let [input-values (range 0.0 6.0 0.5)]
  (proto-repl-charts.charts/line-chart
   "Trigonometry"
   {"sin" (map #(Math/sin %) input-values)
    "cos" (map #(Math/cos %) input-values)}
   {:labels input-values}))

line chart

Displaying a Bar Chart

(proto-repl-charts.charts/bar-chart
  "GDP_By_Year"
  {"2013" [16768 9469 4919 3731]
   "2014" [17418 10380 4616 3859]}
  {:labels ["US" "China" "Japan" "Germany"]})

bar chart

Displaying a Scatter Chart

(let [tlr (java.util.concurrent.ThreadLocalRandom/current)]
  (proto-repl-charts.charts/scatter-chart
   "Randoms"
   {:gaussian (repeatedly 200 #(.nextGaussian tlr))
    :uniform  (repeatedly 200 #(.nextDouble tlr))}))

scatter chart

Displaying a Custom Chart

Displays a custom chart in a tab with the given name. C3 is the charting library used. The chart config will be converted from Clojure to a JavaScript object and passed to C3. It can be any configuration data C3 supports. See C3 examples for more.

(proto-repl-charts.charts/custom-chart
  "Custom"
  {:data {:columns
          [["data1" 30 20 50 40 60 50]
           ["data2" 200 130 90 240 130 220]
           ["data3" 300 200 160 400 250 250]
           ["data4" 200 130 90 240 130 220]
           ["data5" 130 120 150 140 160 150]
           ["data6" 90 70 20 50 60 120]]
          :type "bar"
          :types {:data3 "spline"
                  :data4 "line"
                  :data6 "area"}
          :groups [["data1" "data2"]]}})

custom chart

Displaying a Table

Proto REPL Charts can display a table of data that can be sorted by individual columns. The row data can either be a sequence of sequences or a sequence of maps.

(proto-repl-charts.table/table
  "Users"
  [{:name "Jane" :age 24 :favorite-color :blue}
   {:name "Matt" :age 28 :favorite-color :red}
   {:name "Austin" :age 56 :favorite-color :green}
   {:name "Lisa" :age 32 :favorite-color :green}
   {:name "Peter" :age 32 :favorite-color :green}])

table from maps

Displaying a Graph

Graphs of networks of nodes and edges can be displayed using the proto-repl-charts.graph/graph function.

See Graphs for details.

map graph

Drawing on a Canvas

Proto REPL Charts supports building more complex visualizations by drawing on an HTML canvas embedded within Atom using the proto-repl-charts.canvas/draw function.

See Canvas for details.

Canvas Dragon Curve

proto-repl-charts's People

Contributors

jasongilman avatar moxaj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

proto-repl-charts's Issues

Feature Request: Update multiple charts at once

It would be great, if there was a way to update multiple charts with a single function call.

A usecase for this would be if one wants to visualize the results of a function call in multiple ways to get insight about different aspects of the data (e. g. showing a graph and at the same time a bar chart that shows the # of occurrence of each node label in that graph).

Right now I have to make an update call for every chart manually, which quickly becomes quite laborious. If I missed something and this is already possible, I'd love to know how.

Thanks for developing this great tool!

Charting Doco Miss Match Maybe?

Long last I have project where charting from the REPL solves so many issues... But for the life of me I can not getting it to run.. So I shall share all the thing things I have tried.

Setup

  • Atom 1.15.0
  • Mac OS X 10.12.3
(defproject cljlab "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [proto-repl-charts "0.3.2"]
                 [proto-repl "0.3.1"]
                 [org.clojure/tools.namespace "0.2.11"]]

  :plugins [[lein-ancient "0.6.10"]]

  :main ^:skip-aot cljlab.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})

This Gist contains my full github config

Steps

  1. Alt CMD L Start the repl... No problems starts in the user namespace.
  2. (in-ns 'cljlab.core) works no problems.
cljlab.core
(ns cljlab.core)

(defn -main
  "I don't do a whole lot ... yet."
  [& args]
  (println "Hello, World!"))


(def data-table
  "Doc String that describes the data-table."
  [{:seat "North 1" :align "Right"}
   {:seat "South 1" :align "Left"}
   {:seat "North 2" :align "Right"}
   {:seat "West 1" :align "Right"}
   {:seat "East 1" :align "Left"}])

So let's do a simple table, as per instructions

  1. I enter (proto-repl-charts.table/table "Table Name" data-table) into the file and execute the block.

screen shot 2017-03-10 at 4 58 21 pm

I understand this to mean that proto-repl-charts...... can not be loaded. Well I can not require it in, assuming there is not class... But try anyhow.

screen shot 2017-03-10 at 5 02 41 pm

When autocomplete and all else falls check out the doco... So I found the namespace prc in the doco.

screen shot 2017-03-10 at 5 05 58 pm

But appears to be Deprecated. Yet it appears to work...

screen shot 2017-03-10 at 5 07 46 pm

and it makes a table...

screen shot 2017-03-10 at 5 08 27 pm

Well sort of the Vector has five elements but the table has six row...

(proto-repl-charts.charts/scatter-chart "Scatter" {:dist1 [4.788594844315898
                                                           4.788594844315898 
                                                           4.788594844315898 
                                                           4.788594844315898 
                                                           4.788594844315898 
                                                           4.788594844315898
                                                           4.788594844315898 
                                                           4.788594844315898
                                                           4.788594844315898 
                                                           5.351650552658307 
                                                           5.351650552658307 
                                                           5.351650552658307 
                                                           5.351650552658307 
                                                           5.351650552658307 
                                                           4.707906378929781 
                                                           5.351650552658307 
                                                           5.351650552658307 
                                                           5.351650552658307 
                                                           5.351650552658307 
                                                           5.351650552658307]})

This also appears cool.

screen shot 2017-03-10 at 5 21 08 pm


So here is the question... Is the Doc out of date, or have I gotten the wrong end of the stick?

Any insight appreciated... Thanks in advance.

Ray.

BTW: Happy to fix it and give you a pull request, just want some direction and thinking on your picture.

TableView sets minSpareRows to 1

In this line, TableView sets minSpareRows in the Handsontable to 1, which adds a confusing blank line at the bottom of the table. It appears that removing this line resolves the issue.

Promise.done is deprecated.

Atom now uses ES6 Promises instead of Q. Call promise.then instead of promise.done

Promise.done (/Users/szabolcsbaader/Downloads/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:1203:5)
Object.openNewView (/Users/szabolcsbaader/.atom/packages/proto-repl-charts/lib/proto-repl-charts.coffee:62:10)
Object.display (/Users/szabolcsbaader/.atom/packages/proto-repl-charts/lib/proto-repl-charts.coffee:85:23)
<unknown> (/Users/szabolcsbaader/.atom/packages/proto-repl-charts/lib/proto-repl-charts.coffee:31:28)
ExtensionsFeature.handleReplResult (/Users/szabolcsbaader/.atom/packages/proto-repl/lib/features/extensions-feature.coffee:31:11)
<unknown> (/Users/szabolcsbaader/.atom/packages/proto-repl/lib/repl.coffee:315:42)

Uncaught TypeError: Cannot read property 'getItem' of undefined

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.42.0 x64
Electron: 4.2.7
OS: Mac OS X 10.15.2
Thrown From: proto-repl-charts package 0.4.1

Stack Trace

Uncaught TypeError: Cannot read property 'getItem' of undefined

At /Users/davidb/.atom/packages/proto-repl-charts/node_modules/jg-c3/c3.js:3360

TypeError: Cannot read property 'getItem' of undefined
    at ChartInternal.c3_chart_internal_fn.isWithinBar (/packages/proto-repl-charts/node_modules/jg-c3/c3.js:3360:37)
    at ChartInternal.c3_chart_internal_fn.isWithinShape (/packages/proto-repl-charts/node_modules/jg-c3/c3.js:2846:54)
    at /packages/proto-repl-charts/node_modules/jg-c3/c3.js:2530:61)
    at /packages/proto-repl-charts/node_modules/d3/d3.js:962:16
    at d3_selection_each (/packages/proto-repl-charts/node_modules/d3/d3.js:968:30)
    at Array.d3_selectionPrototype.each (/packages/proto-repl-charts/node_modules/d3/d3.js:961:12)
    at /packages/proto-repl-charts/node_modules/jg-c3/c3.js:2529:68)
    at SVGRectElement.__onclick (/packages/proto-repl-charts/node_modules/d3/d3.js:1120:18)

Commands

     -4:05.3.0 core:paste (input.hidden-input)
     -4:04.2.0 proto-repl:execute-text-entered-in-repl (input.hidden-input)
     -1:43.4.0 core:paste (input.hidden-input)
  2x -1:31.8.0 core:move-down (input.hidden-input)
     -1:30.4.0 autocomplete-plus:confirm (input.hidden-input)
  6x -1:28.8.0 core:move-right (input.hidden-input)
     -1:25.6.0 proto-repl:execute-text-entered-in-repl (input.hidden-input)
     -1:06.6.0 core:paste (input.hidden-input)
     -1:04.1.0 proto-repl:execute-text-entered-in-repl (input.hidden-input)
     -0:23.4.0 core:paste (input.hidden-input)
     -0:22.2.0 proto-repl:execute-text-entered-in-repl (input.hidden-input)

Non-Core Packages

atom-ide-ui 0.13.0 
chlorine 0.3.7 
go-build 0.2.2 
go-debug 1.7.0 
go-plus 6.1.0 
go-signature-statusbar 1.2.3 
ink 0.11.7 
parinfer 1.23.0 
proto-repl 1.4.24 
proto-repl-charts 0.4.1 
pymakr 1.5.6 
teletype 0.13.4 

prc/graph can't display fonts

I'm playing around with the graph examples from proto-repl-charts.

However, the vis.js-based graphs seems not to work on my setup.

The following code
(prc/graph "A Graph from a map" {:nodes [:a :b :c :d :e :f :g] :edges [[:d :b] [:b :c] [:d :c] [:e :f] [:f :g] [:d :a] [:f :c]]})

leads to a graph with only blocks instead of any text displayed. Similar behavior with the loom graphs.

https://goo.gl/photos/zxPPBzMYQqtJrQ667

Any idea on how to resolve this is very welcome!

Thanks,
Robert

Failed to load the proto-repl-charts package

[Enter steps to reproduce:]

  1. Launched Atom
  2. Received that self generated report. Hopefully, this would be beneficial for the community

Atom: 1.59.0 x64
Electron: 9.4.4
OS: Ubuntu 20.04.3
Thrown From: proto-repl-charts package 0.4.1

Stack Trace

Failed to load the proto-repl-charts package

At Unexpected token 'export'

/home/alexander/.atom/packages/proto-repl-charts/node_modules/st8/st8.js:115
export default State;
^^^^^^

SyntaxError: Unexpected token 'export'
    at new Script (vm.js:84:7)
    at NativeCompileCache.runInThisContext (/usr/share/atom/resources/app/static/<embedded>:11:148814)
    at Module.get_Module._compile (/usr/share/atom/resources/app/static/<embedded>:11:149668)
    at Object.value [as .js] (/usr/share/atom/resources/app/static/<embedded>:11:153485)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module._load (electron/js2c/asar.js:769:28)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (/usr/share/atom/resources/app/static/<embedded>:11:149207)
    at /packages/proto-repl-charts/node_modules/define-state/index.js:6:13)
    at /packages/proto-repl-charts/node_modules/define-state/index.js:48:3)
    at Module.get_Module._compile (/usr/share/atom/resources/app/static/<embedded>:11:149891)
    at Object.value [as .js] (/usr/share/atom/resources/app/static/<embedded>:11:153485)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module._load (electron/js2c/asar.js:769:28)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (/usr/share/atom/resources/app/static/<embedded>:11:149207)
    at /packages/proto-repl-charts/node_modules/draggy/index.js:30:21)
    at /packages/proto-repl-charts/node_modules/draggy/index.js:977:3)
    at Module.get_Module._compile (/usr/share/atom/resources/app/static/<embedded>:11:149891)
    at Object.value [as .js] (/usr/share/atom/resources/app/static/<embedded>:11:153485)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module._load (electron/js2c/asar.js:769:28)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (/usr/share/atom/resources/app/static/<embedded>:11:149207)
    at /packages/proto-repl-charts/node_modules/resizable/index.js:6:17)
    at /packages/proto-repl-charts/node_modules/resizable/index.js:474:3)
    at Module.get_Module._compile (/usr/share/atom/resources/app/static/<embedded>:11:149891)

Commands

Non-Core Packages

atom-ide-base 3.4.0 
atom-ide-code-format 1.0.2 
atom-ide-datatip 0.25.0 
atom-ide-definitions 0.4.2 
atom-ide-hyperclick 1.0.11 
atom-ide-markdown-service 2.1.0 
atom-ide-outline 3.2.0 
atom-ide-signature-help 0.16.0 
atom-ide-ui 0.13.0 
busy-signal 2.0.1 
haskell 0.1.0 
ide-haskell 2.7.0 
ide-haskell-cabal 2.6.1 
ide-python 1.9.7 
ink 0.12.6 
intentions 2.1.1 
language-haskell 1.24.0 
linter 3.4.0 
linter-ui-default 3.4.1 
parinfer 1.24.1 
proto-repl 1.4.24 
proto-repl-charts 0.4.1 
proto-repl-sayid 0.1.4 
script 3.32.2 

Displaying graph with numeric symbol ids fails

(proto-repl-charts.graph/graph
 "Test"
 {:nodes [{:id :1 :label :a} {:id :2 :label :b}]
  :edges [[:1 :2]]})

sayid_test_clj_ __work_github_workspace_proto-repl-clojure-conj_and_graphs_md ___work_github_workspace_proto-repl-charts

The stack trace seems incorrect:

/Users/jason/work/github_workspace/proto-repl/lib/process/nrepl-connection.coffee:231 TypeError: Cannot read property '0' of null(…)(anonymous function) @ /Users/jason/work/github_workspace/proto-repl/lib/process/nrepl-connection.coffee:231

Uncaught Error: Module did not self-register.

[Enter steps to reproduce below:]

  1. Execute following code in proto-repl:
(require 'prc)
(defn f [x] (* x x))
(prc/line-chart "My F" {"f" (map f (range 0.0 0.6 0.2))})
  1. See that a blank (white) page is shown instead of any chart.
  2. Execute the last line again.
  3. See the red box displayed by Atom: "Uncaught Error: Module did not self-register."

Atom Version: 1.5.3
System: Ubuntu 14.04.4
Thrown From: proto-repl-charts package, v0.1.0

Stack Trace

Uncaught Error: Module did not self-register.

At events.js:141

Error: Module did not self-register.
  at Error (native)
  at Object.module.(anonymous function) (ATOM_SHELL_ASAR.js:137:20)
  at Object.module.(anonymous function) [as .node] (ATOM_SHELL_ASAR.js:137:20)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:50:27)
  at bindings (@HOME@/.atom/packages/proto-repl-charts/node_modules/c3/node_modules/d3/node_modules/jsdom/node_modules/contextify/node_modules/bindings/bindings.js:76:44)
  at Object.<anonymous> (@HOME@/.atom/packages/proto-repl-charts/node_modules/c3/node_modules/d3/node_modules/jsdom/node_modules/contextify/lib/contextify.js:1:113)
  at Module._compile (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:103:30)
  at Object.defineProperty.value [as .js] (/usr/share/atom/resources/app.asar/src/compile-cache.js:208:21)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:50:27)
  at Object.<anonymous> (@HOME@/.atom/packages/proto-repl-charts/node_modules/c3/node_modules/d3/node_modules/jsdom/lib/jsdom/browser/index.js:14:21)
  at Module._compile (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:103:30)
  at Object.defineProperty.value [as .js] (/usr/share/atom/resources/app.asar/src/compile-cache.js:208:21)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:50:27)
  at Object.<anonymous> (@HOME@/.atom/packages/proto-repl-charts/node_modules/c3/node_modules/d3/node_modules/jsdom/lib/jsdom.js:11:20)
  at Module._compile (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:103:30)
  at Object.defineProperty.value [as .js] (/usr/share/atom/resources/app.asar/src/compile-cache.js:208:21)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:50:27)
  at Object.<anonymous> (@HOME@/.atom/packages/proto-repl-charts/node_modules/c3/node_modules/d3/index.js:1:95)
  at Module._compile (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:103:30)
  at Object.defineProperty.value [as .js] (/usr/share/atom/resources/app.asar/src/compile-cache.js:208:21)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:50:27)
  at new ChartInternal (@HOME@/.atom/packages/proto-repl-charts/node_modules/c3/c3.js:49:74)
  at new Chart (@HOME@/.atom/packages/proto-repl-charts/node_modules/c3/c3.js:32:34)
  at Object.c3.generate (@HOME@/.atom/packages/proto-repl-charts/node_modules/c3/c3.js:58:16)
  at ChartView.module.exports.ChartView.display (@HOME@/.atom/packages/proto-repl-charts/lib/chart-view.coffee:35:19)
  at Object.module.exports.ProtoReplCharts.display (@HOME@/.atom/packages/proto-repl-charts/lib/proto-repl-charts.coffee:65:14)
  at @HOME@/.atom/packages/proto-repl-charts/lib/proto-repl-charts.coffee:27:12
  at @HOME@/.atom/packages/proto-repl/lib/repl.coffee:279:11
  at @HOME@/.atom/packages/proto-repl/lib/repl.coffee:168:11
  at Transform.msgHandler (@HOME@/.atom/packages/proto-repl/node_modules/jg-nrepl-client/src/nrepl-client.js:130:21)
  at emitOne (events.js:77:13)
  at Transform.emit (events.js:169:7)
  at @HOME@/.atom/packages/proto-repl/node_modules/jg-nrepl-client/src/nrepl-client.js:103:9
  at Array.forEach (native)
  at consumeNreplMessageStream (@HOME@/.atom/packages/proto-repl/node_modules/jg-nrepl-client/src/nrepl-client.js:101:28)
  at Transform.messageStream._transform (@HOME@/.atom/packages/proto-repl/node_modules/jg-nrepl-client/src/nrepl-client.js:75:38)
  at Transform._read (_stream_transform.js:167:10)
  at Transform._write (_stream_transform.js:155:12)
  at doWrite (_stream_writable.js:292:12)
  at writeOrBuffer (_stream_writable.js:278:5)
  at Transform.Writable.write (_stream_writable.js:207:11)
  at Socket.ondata (_stream_readable.js:525:20)
  at emitOne (events.js:77:13)
  at Socket.emit (events.js:169:7)
  at readableAddChunk (_stream_readable.js:146:16)
  at Socket.Readable.push (_stream_readable.js:110:10)
  at TCP.onread (net.js:523:20)

Commands

     -1:04.7.0 proto-repl:toggle (atom-text-editor.editor.is-focused)
     -0:59.7.0 core:delete (atom-text-editor.editor.is-focused)
     -0:57.1.0 proto-repl:execute-text-entered-in-repl (atom-text-editor.editor.is-focused.autocomplete-active)
     -0:50 core:backspace (atom-text-editor.editor.is-focused)
     -0:47.5.0 core:move-right (atom-text-editor.editor.is-focused)
     -0:44.5.0 editor:move-to-end-of-screen-line (atom-text-editor.editor.is-focused)
     -0:44.1.0 proto-repl:execute-text-entered-in-repl (atom-text-editor.editor.is-focused)
  6x -0:38.5.0 core:backspace (atom-text-editor.editor.is-focused)
  2x -0:30.2.0 core:move-right (atom-text-editor.editor.is-focused)
     -0:14.7.0 editor:move-to-end-of-screen-line (atom-text-editor.editor.is-focused)
     -0:13.8.0 proto-repl:execute-text-entered-in-repl (atom-text-editor.editor.is-focused)
     -0:04.3.0 editor:select-to-first-character-of-line (atom-text-editor.editor.is-focused)
     -0:03.5.0 core:copy (atom-text-editor.editor.is-focused)
     -0:02.6.0 core:paste (atom-text-editor.editor.is-focused)
     -0:01.2.0 proto-repl:execute-text-entered-in-repl (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "autoHideMenuBar": true,
    "customFileTypes": {
      "source.ini": [
        ".buckconfig",
        ".flowconfig"
      ],
      "source.json": [
        ".arcconfig"
      ],
      "source.python": [
        "BUCK"
      ]
    },
    "disabledPackages": [
      "tree-view"
    ]
  }
}

Installed Packages

# User
Parinfer, v1.14.0
haskell-grammar, v0.4.0
highlight-selected, v0.11.2
language-babel, v2.15.4
language-cuda, v0.1.0
language-glsl, v2.0.1
language-hlsl, v1.2.0
language-hy, v0.1.0
language-ini, v1.14.0
language-latex, v0.6.1
language-lua, v0.9.4
language-nftables, v0.2.1
language-ocaml, v1.1.2
language-opencl, v0.1.1
language-rust, v0.4.6
language-thrift, v1.0.2
language-tmux, v0.4.0
latex, v0.29.0
latexer, v0.3.0
linter, v1.11.3
linter-clang, v3.4.4
linter-clojure, v1.1.2
linter-csslint, v1.3.1
linter-gcc, v0.6.7
linter-glsl, v1.0.6
linter-htmlhint, v1.0.3
linter-lua, v1.0.1
linter-luacheck, v1.1.4
linter-php, v1.1.8
linter-rust, v0.4.1
linter-tidy, v2.1.0
minimap, v4.19.0
nuclide, v0.119.0
pdf-view, v0.39.0
project-manager, v2.7.6
proto-repl, v0.15.2
proto-repl-charts, v0.1.0
tool-bar, v0.2.1
travis-ci-status, v1.0.0

# Dev
No dev packages

Can't get this to work in self hosted REPL

Following the README just gets me

TypeError: Cannot read property 'line_chart' of undefined

Also followed Option 2. Opinionated, Complete, Best Way to Setup Atom for Clojure Development with Proto REPL for setting up

Uncaught TypeError: Cannot read property 'value' of null

When running the first example from the docs:

(proto-repl-charts.charts/line-chart
 "Trigonometry"
 {"sin" (map #(Math/sin %) (range 0.0 6.0 0.2))
  "cos" (map #(Math/cos %) (range 0.0 6.0 0.2))})

the error below occurs. But - it doesn't happen the first time I execute it, only when I execute it the second time (and third, ...).

Atom: 1.15.0 x64
Electron: 1.3.13
OS: Mac OS X 10.11.6
Thrown From: proto-repl-charts package 0.4.0

Stack Trace

Uncaught TypeError: Cannot read property 'value' of null

At /Users/nicke/.atom/packages/proto-repl-charts/node_modules/jg-c3/c3.js:3864

TypeError: Cannot read property 'value' of null
    at /packages/proto-repl-charts/node_modules/jg-c3/c3.js:3864:56
    at Array.sort (native)
    at ChartInternal.c3_chart_internal_fn.getTooltipContent (/packages/proto-repl-charts/node_modules/jg-c3/c3.js:3863:15)
    at ChartInternal.tooltip_contents (/packages/proto-repl-charts/node_modules/jg-c3/c3.js:1273:54)
    at ChartInternal.c3_chart_internal_fn.showTooltip (/packages/proto-repl-charts/node_modules/jg-c3/c3.js:3947:49)
    at /packages/proto-repl-charts/node_modules/jg-c3/c3.js:2481:24)
    at SVGRectElement.__onmousemove (/packages/proto-repl-charts/node_modules/d3/d3.js:1120:18)

Commands

     -1:52 proto-repl:execute-top-block (input.hidden-input)
  6x -1:42.7.0 vim-mode-plus:move-right (input.hidden-input)
     -1:41.2.0 vim-mode-plus:replace-character (input.hidden-input)
     -1:41 vim-mode-plus:set-input-char-1 (input.hidden-input)
  2x -1:40.4.0 vim-mode-plus:reset-normal-mode (input.hidden-input)
     -1:39.1.0 proto-repl:execute-top-block (input.hidden-input)
     -1:31.1.0 autocomplete-plus:cancel (atom-text-editor.editor.is-focused)
     -1:26.4.0 vim-mode-plus:move-up (input.hidden-input)
     -1:24.5.0 proto-repl:execute-top-block (input.hidden-input)
     -1:22.6.0 proto-repl:toggle (input.hidden-input)
  2x -1:22.4.0 autocomplete-plus:cancel (atom-text-editor.editor)
     -1:17 proto-repl:execute-top-block (input.hidden-input)
  3x -1:17 autocomplete-plus:cancel (atom-text-editor.editor)
     -1:15.5.0 bracket-matcher:go-to-matching-bracket (div.proto-repl-charts-chart.native-key-bindings)
  2x -1:14.8.0 core:cancel (div.proto-repl-charts-chart.native-key-bindings)
     -1:11.8.0 proto-repl:execute-top-block (input.hidden-input)

Non-Core Packages

advanced-open-file 0.16.6 
atom-beautify 0.29.17 
atom-dark-fusion-syntax 2.2.0 
atom-material-syntax 1.0.2 
atom-material-ui 1.3.9 
atom-mdtoc 0.8.3 
atomatigit 1.5.5 
autocomplete-paths 1.0.5 
autoupdate-packages 1.3.1 
blame 0.10.3 
busy 0.7.0 
busy-signal 1.3.0 
easy-motion-redux 1.1.1 
environment 1.3.1 
ex-mode 0.14.0 
expand-region 0.2.6 
file-icons 2.1.2 
file-watcher 1.1.0 
git-history 3.3.0 
git-plus 7.3.3 
golden-ratio 0.3.0 
highlight-line 0.12.0 
highlight-selected 0.13.1 
ink 0.6.5 
intentions 1.1.2 
language-diff 0.7.0 
lines 0.13.1 
linter 2.1.2 
linter-clojure 1.1.3 
linter-markdown 3.1.0 
linter-ui-default 1.2.2 
markdown-preview-enhanced 0.10.11 
markdown-scroll-sync 2.1.2 
markdown-writer 2.6.4 
maximize-panes 0.2.0 
merge-conflicts 1.4.4 
move-panes 0.2.0 
nucleus-dark-ui 0.11.0 
Parinfer 1.17.0 
project-plus 0.9.0 
proto-repl 1.4.18 
proto-repl-charts 0.4.0 
proton-mode 0.15.0 
recent-files-fuzzy-finder 0.3.1 
relative-numbers 0.7.1 
release-notes 0.53.0 
tab-switcher 1.5.4 
theme-switch 0.4.0 
vim-mode-plus 0.85.1 
vim-mode-plus-ex-mode 0.9.0 
wordcount 2.10.4 
zentabs 0.8.8 

usage with a remote repl?

I am loving proto-repl and proto-repl-charts.

So far the implementation has been seamless and I really want to thank you for making these plugins, they're great.

Currently within the atom editor I am connecting to a remote nrepl server using the Proto repl: Remote Nrepl Connection. This works out great and no problems evaluating lines of code but when I try to plot something for instance:

(proto-repl-charts.charts/line-chart
 "Trigonometry"
 {"sin" (map #(Math/sin %) (range 0.0 6.0 0.2))
  "cos" (map #(Math/cos %) (range 0.0 6.0 0.2))})

I get an error
ClassNotFoundException proto-repl-charts.charts java.net.URLClassLoader.findClass (URLClassLoader.java:381)

Is there any reason why plotting with nrepl would not work? As a check I have tried plotting using incanter and the plot shows up fine using that chart library.

Spaces in chart title are displayed as %20 in tab title

When creating a chart with spaces in its title, they are displayed as %20 in the tab title.

Example:

(defn f [x] (* x x))
(prc/line-chart "My F" {"f" (map f (range 0.0 0.6 0.2))})

Creates a chart tab titled "My%20F".

Maybe-Related: #3

Failing while installing on Windows

Installation of this package is failed and it gave me the next log:

> [email protected] install C:\Users\grish\AppData\Local\Temp\apm-install-dir-116125-1944-1sbp8sr\node_modules\proto-repl-charts\node_modules\c3\node_modules\d3\node_modules\jsdom\node_modules\contextify
> node-gyp rebuild


C:\Users\grish\AppData\Local\Temp\apm-install-dir-116125-1944-1sbp8sr\node_modules\proto-repl-charts\node_modules\c3\node_modules\d3\node_modules\jsdom\node_modules\contextify>if not defined npm_config_node_gyp (node "C:\Users\grish\AppData\Local\atom\app-1.5.3\resources\app\apm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild ) 

gypnpm ERR! Windows_NT 6.2.9200
npm ERR! argv "C:\\Users\\grish\\AppData\\Local\\atom\\app-1.5.3\\resources\\app\\apm\\bin\\node.exe" "C:\\Users\\grish\\AppData\\Local\\atom\\app-1.5.3\\resources\\app\\apm\\node_modules\\npm\\bin\\npm-cli.js" "--globalconfig" "C:\\Users\\grish\\.atom\\.apm\\.apmrc" "--userconfig" "C:\\Users\\grish\\.atom\\.apmrc" "install" "C:\\Users\\grish\\AppData\\Local\\Temp\\d-116125-1944-15dx1i2\\package.tgz" "--target=0.34.5" "--arch=ia32"
npm ERR! node v0.10.40
npm ERR! npm  v2.13.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls contextify
npm ERR! There is likely additional logging output above.

My OS is Windows 10 and I already have the 'proto-repl' package in Atom.

Reevaluating line-chart creates error message

Steps to reproduce:

  • Proto Repl: Toggle
  • Evaluate:
    (proto-repl-charts.charts/line-chart
     "Trigonometry"
     {"sin" (map #(Math/sin %) (range 0.0 6.0 0.2))
      "cos" (map #(Math/cos %) (range 0.0 6.0 0.2))})
  • Evaluate the same thing again

This produces the following error message:

Error in handler: TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.

TypeError: Failed to execute 'dispatchEvent' on
'EventTarget': parameter 1 is not of type 'Event'.

Other than the message, no other unwanted effects seem to occur. Is there a way that I can prevent this message from appearing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.