GithubHelp home page GithubHelp logo

yuhan0 / portal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from djblue/portal

0.0 0.0 0.0 3.5 MB

A clojure tool to navigate through your data.

Home Page: https://djblue.github.io/portal/

License: MIT License

JavaScript 0.14% Emacs Lisp 0.19% Java 0.12% Clojure 99.55%

portal's Introduction

portal

A clojure tool to navigate through your data.

Clojars Project VS Code Extension Version Get help on Slack

screenshot

The portal UI can be used to inspect values of various shapes and sizes. The UX will probably evolve over time and user feedback is welcome!

For an in-depth explanation of the UI, you can jump to the UI docs.

Demo

To get an overview of the Portal UI and workflow, checkout the following recording of a live demo I gave for London Clojurians.

London Clojurians Demo

Usage

To start a repl with portal, run the clojure >= 1.10.0 cli with:

clj -Sdeps '{:deps {djblue/portal {:mvn/version "0.25.0"}}}'

or for a web clojurescript >= 1.10.773 repl, do:

clj -Sdeps '{:deps {djblue/portal {:mvn/version "0.25.0"}
                    org.clojure/clojurescript {:mvn/version "1.10.844"}}}' \
    -m cljs.main

or for a node clojurescript >= 1.10.773 repl, do:

clj -Sdeps '{:deps {djblue/portal {:mvn/version "0.25.0"}
                    org.clojure/clojurescript {:mvn/version "1.10.844"}}}' \
    -m cljs.main -re node

or for a babashka >=0.2.4 repl, do:

bb -cp `clj -Spath -Sdeps '{:deps {djblue/portal {:mvn/version "0.25.0"}}}'`

or for examples on how to integrate portal into an existing project, look through the examples directory.

NOTE: Portal can also be used without a runtime via the standalone version. The standalone version can be installed as a chrome pwa which will provide a dock launcher for easy access.

API

Try the portal api with the following commands:

;; for node and jvm
(require '[portal.api :as p])

;; for web
;; NOTE: you might need to enable popups for the portal ui to work in the
;; browser.
(require '[portal.web :as p])


(def p (p/open)) ; Open a new inspector

;; or with an extension installed, do:
(def p (p/open {:launcher :vs-code}))  ; JVM only for now
(def p (p/open {:launcher :intellij})) ; JVM only for now

(add-tap #'p/submit) ; Add portal as a tap> target

(tap> :hello) ; Start tapping out values

(p/clear) ; Clear all values

(tap> :world) ; Tap out more values

(prn @p) ; bring selected value back into repl

(remove-tap #'p/submit) ; Remove portal from tap> targetset

(p/close) ; Close the inspector when done

NOTE: portal will keep objects from being garbage collected until they are cleared from the UI.

Options

By default, when p/open is called, an HTTP server is started on a randomly chosen port. It is also given a default window title of the form portal - <platform> - <version>. To control this server's port, host, and window title, call the p/start function with the following options:

Option Description If not specified
:port Port used to access UI random port selected
:host Hostname used to access UI "localhost"
:app Launch as separate window true
:window-title Custom title for UI window "portal"

For more documentation, take a look through the docs.

portal's People

Contributors

djblue avatar brianchevalier avatar dependabot[bot] avatar davidpham87 avatar coyotesqrl avatar burinc avatar holyjak avatar rfhayashi avatar yvern avatar xceno avatar wilkerlucio avatar brdloush avatar lambeaux avatar rzwiefel avatar olymk2 avatar justone avatar fancygits avatar cyrik avatar jj-atkinson avatar dosbol avatar meditans avatar bennyandresen avatar andyhorng avatar

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.