Electron.jl: Julia Wrapper for Electron

Electron 

Overview

Electron.jl wraps the cross-platform desktop application framework Electron. You can use it to build GUI applications in julia.

Alternatives

Blink.jl provides similar functionality (and was a major inspiration for this package!). The main difference between the two packages is that Electron.jl opts for a more minimalistic feature set than Blink.jl. Here are some key differences between the two packages:

  • Electron.jl does not have any web server functionality.
  • Electron.jl has no functionality to translate julia code to JavaScript.
  • Electron.jl uses named pipes for the communication between julia and the electron process (no more firewall warnings!).
  • Electron.jl doesn't integrate with the Juno stack of packages, Blink.jl does in some way (that I don't understand).
  • Electron.jl has a high test coverage.
  • Electron.jl always installs a private copy of Electron during the build phase.

Installation

You can install the package with:

Pkg.add("Electron")

Getting started

Electron.jl introduces two fundamental types: Application represents a running electron application, Window is a visible UI window. A julia process can have arbitrarily many applications running at the same time, each represented by its own Application instance. If you don't want to deal with Applications you can also just ignore them, in that case Electron.jl will create a default application for you automatically.

To create a new application, simply call the corresponding constructor:

using Electron

app = Application()

This will start a new Electron process that is ready to open windows or run JavaScript code.

To create a new window in an existing application, use the Window constructor:

using Electron, URIs

app = Application()

win = Window(app, URI("file://main.html"))

Note that you need to pass a URI that points to an HTML file to the Window constructor. This HTML file will be displayed in the new window.

You can update pre-existing Window using function load:

load(win, URI("http://julialang.org"))
load(win, """
<img src="https://raw.githubusercontent.com/JuliaGraphics/julia-logo-graphics/master/images/julia-logo-325-by-225.png">
""")

You can also call the Window constructor without passing an Application, in that case Electron.jl creates a default application for you:

using Electron, URIs

win = Window(URI("file://main.html"))

You can run JavaScript code both in the main or the render thread of a specific window. To run some JavaScript in the main thread, call the run function and pass an Application instance as the first argument:

using Electron

app = Application()

result = run(app, "Math.log(10)")

The second argument of the run function is JavaScript code that will simply be executed as is in Electron.

You can also run JavaScript in the render thread of any open window by passing the corresponding Window instance as the first argument to run:

using Electron, URIs

win = Window(URI("file://main.html"))

result = run(win, "Math.log(10)")

You can send messages from a render thread back to julia by calling the javascript function sendMessageToJulia. On the julia side, every window has a Channel for these messages. You can access the channel for a given window with the msgchannel function, and then use the standard julia API to take messages out of this channel:

using Electron

win = Window()

result = run(win, "sendMessageToJulia('foo')")

ch = msgchannel(win)

msg = take!(ch)

println(msg)

Examples

The following packages currently use Electron.jl:

Please add any other packages that depend on Electron.jl to this list via a pull request!

Download Details:

Author: Davidanthoff
Source Code: https://github.com/davidanthoff/Electron.jl 
License: View license

#julia #electron 

What is GEEK

Buddha Community

Electron.jl: Julia Wrapper for Electron

Electron.jl: Julia Wrapper for Electron

Electron 

Overview

Electron.jl wraps the cross-platform desktop application framework Electron. You can use it to build GUI applications in julia.

Alternatives

Blink.jl provides similar functionality (and was a major inspiration for this package!). The main difference between the two packages is that Electron.jl opts for a more minimalistic feature set than Blink.jl. Here are some key differences between the two packages:

  • Electron.jl does not have any web server functionality.
  • Electron.jl has no functionality to translate julia code to JavaScript.
  • Electron.jl uses named pipes for the communication between julia and the electron process (no more firewall warnings!).
  • Electron.jl doesn't integrate with the Juno stack of packages, Blink.jl does in some way (that I don't understand).
  • Electron.jl has a high test coverage.
  • Electron.jl always installs a private copy of Electron during the build phase.

Installation

You can install the package with:

Pkg.add("Electron")

Getting started

Electron.jl introduces two fundamental types: Application represents a running electron application, Window is a visible UI window. A julia process can have arbitrarily many applications running at the same time, each represented by its own Application instance. If you don't want to deal with Applications you can also just ignore them, in that case Electron.jl will create a default application for you automatically.

To create a new application, simply call the corresponding constructor:

using Electron

app = Application()

This will start a new Electron process that is ready to open windows or run JavaScript code.

To create a new window in an existing application, use the Window constructor:

using Electron, URIs

app = Application()

win = Window(app, URI("file://main.html"))

Note that you need to pass a URI that points to an HTML file to the Window constructor. This HTML file will be displayed in the new window.

You can update pre-existing Window using function load:

load(win, URI("http://julialang.org"))
load(win, """
<img src="https://raw.githubusercontent.com/JuliaGraphics/julia-logo-graphics/master/images/julia-logo-325-by-225.png">
""")

You can also call the Window constructor without passing an Application, in that case Electron.jl creates a default application for you:

using Electron, URIs

win = Window(URI("file://main.html"))

You can run JavaScript code both in the main or the render thread of a specific window. To run some JavaScript in the main thread, call the run function and pass an Application instance as the first argument:

using Electron

app = Application()

result = run(app, "Math.log(10)")

The second argument of the run function is JavaScript code that will simply be executed as is in Electron.

You can also run JavaScript in the render thread of any open window by passing the corresponding Window instance as the first argument to run:

using Electron, URIs

win = Window(URI("file://main.html"))

result = run(win, "Math.log(10)")

You can send messages from a render thread back to julia by calling the javascript function sendMessageToJulia. On the julia side, every window has a Channel for these messages. You can access the channel for a given window with the msgchannel function, and then use the standard julia API to take messages out of this channel:

using Electron

win = Window()

result = run(win, "sendMessageToJulia('foo')")

ch = msgchannel(win)

msg = take!(ch)

println(msg)

Examples

The following packages currently use Electron.jl:

Please add any other packages that depend on Electron.jl to this list via a pull request!

Download Details:

Author: Davidanthoff
Source Code: https://github.com/davidanthoff/Electron.jl 
License: View license

#julia #electron 

Electron.jl: Provides Easy Access to Atom/electron From Julia

Electron.jl

Provides easy access to atom/electron from Julia

Installation

@require "github.com/jkroso/Electron.jl" => Electron

See Rutherford.jl for example usage

API

latest()

Returns the VersionNumber of electons latest release

install(::VersionNumber)

Installs a given version of Electron and returns the path to its executable

import Electron
electron = Electron.install(Electron.latest())
stdin,process = open(`$electron path/to/your/app`, "w")

App

Boots up an Electron app which can have messages written to its stdin in order to open windows

const app = App("Electron")

Download Details:

Author: jkroso
Source Code: https://github.com/jkroso/Electron.jl 

#julia #electron 

TetGen.jl: Julia's TetGen Wrapper

TetGen

The TetGen.jl package is a Julia wrapper for the C++ project TetGen. This wrapper enables TetGen based tetrahedral meshing, and (constrained) 3D Delaunay and Voronoi tesselation.

If you find TetGen useful, please consider citing Hang Si: "TetGen, a Delaunay-Based Quality Tetrahedral Mesh Generator" ACM Trans. on Mathematical Software. 41 (2), 2015 http://doi.acm.org/10.1145/2629697.

Example using GeometryBasics datatypes

using TetGen
using GeometryBasics
using GeometryBasics: Mesh, QuadFace

# Construct a cube out of Quads
points = Point{3, Float64}[
    (0.0, 0.0, 0.0), (2.0, 0.0, 0.0),
    (2.0, 2.0, 0.0), (0.0, 2.0, 0.0),
    (0.0, 0.0, 12.0), (2.0, 0.0, 12.0),
    (2.0, 2.0, 12.0), (0.0, 2.0, 12.0)
]

facets = QuadFace{Cint}[
    1:4,
    5:8,
    [1,5,6,2],
    [2,6,7,3],
    [3, 7, 8, 4],
    [4, 8, 5, 1]
]

markers = Cint[-1, -2, 0, 0, 0, 0]
# attach some additional information to our faces!
mesh = Mesh(points, meta(facets, markers=markers))
result = tetrahedralize(mesh, "vpq1.414a0.1")

using GLMakie

GLMakie.mesh(normal_mesh(result), color=(:blue, 0.1), transparency=true)
GLMakie.wireframe!(result)

Plotted with Makie:

image

Example using plain Julia arrays

using TetGen
let
    tetunsuitable() do pa,pb,pc,pd
        vol=det(hcat(pb-pa,pc-pa,pd-pa))/6
        center=0.25*(pa+pb+pc+pd)-[0.5,0.5,0.5]
        vol> 0.05*norm(center)^2.5
    end

    input=TetGen.RawTetGenIO{Cdouble}()
    input.pointlist=[0 0 0;  
                     1 0 0;
                     1 1 0;
                     0 1 0;
                     0 0 1;  
                     1 0 1;
                     1 1 1;
                     0 1 1]'

    TetGen.facetlist!(input,[1 2 3 4;
                             5 6 7 8;
                             1 2 6 5;
                             2 3 7 6;
                             3 4 8 7;
                             4 1 5 8]')
    tetrahedralize(input, "pQa")
end

Output:

RawTetGenIO(
numberofpoints=169,
numberofedges=27,
numberoftrifaces=112,
numberoftetrahedra=809,
pointlist'=[0.0 1.0 … 0.500059730245037 0.4996534431688176; 0.0 0.0 … 0.5074057466787957 0.49707528530503103; 0.0 0.0 … 0.5033015055704277 0.4953177845338027],
tetrahedronlist'=Int32[34 47 … 15 143; 6 24 … 143 15; 58 52 … 154 150; 70 73 … 168 168],
trifacelist'=Int32[3 58 … 99 22; 19 6 … 22 8; 78 70 … 158 158],
trifacemarkerlist'=Int32[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1  …  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
edgelist'=Int32[3 5 … 70 157; 18 24 … 6 32],
edgemarkerlist'=Int32[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1  …  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
)

Contributing

Code of conduct

Download Details:

Author: JuliaGeometry
Source Code: https://github.com/JuliaGeometry/TetGen.jl 
License: MIT license

#julia #wrapper 

CoolProp.jl: A Julia Wrapper for CoolProp

CoolProp.jl

A Julia wrapper for CoolProp

This is not my work, and all the credit goes to the cool CoolProp contributors. I only put this together to make things easier for a friend of mine.

Installation

using Pkg
Pkg.add("CoolProp")

Usage

The API is described in http://www.coolprop.org/coolprop/HighLevelAPI.html.

You can obtain e.g. the boiling point of water like this:

using CoolProp
PropsSI("T", "P", 101325.0, "Q", 0.0, "Water")
373.1242958476844

The Unitful package is also supported. When you make a call to PropsSI using units, the result will also have the relevant units:

using CoolProp
using Unitful: °C, Pa

PropsSI("P", "T", 100°C, "Q", 0.0, "Water")
101417.99665788244 Pa

Humid air properties are available using the HAPropsSI function, e.g. getting the enthalpy at 20°c and 50 % relative humidity:

using CoolProp
using Unitful: °C, Pa

HAPropsSI("H", "Tdb", 20°C, "RH", 0.5, "P", 101325Pa)
38622.83892391293 J kg⁻¹

(http://www.coolprop.org)

Download Details:

Author: CoolProp
Source Code: https://github.com/CoolProp/CoolProp.jl 
License: View license

#julia #wrapper 

Seaborn.jl: Julia Wrapper for Seaborn

Seaborn

A Julia wrapper around the Seaborn data visualization library:

Seaborn is a Python data visualization library based on matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics.

For a brief introduction to the ideas behind the library, you can read the introductory notes or the paper. Visit the installation page to see how you can download the package and get started with it. You can browse the example gallery to see some of the things that you can do with seaborn, and then check out the tutorial or API reference to find out how.

To see the code or report a bug, please visit the GitHub repository. General support questions are most at home on stackoverflow or discourse, which have dedicated channels for seaborn.

Gallery Gallery Gallery Gallery Gallery Gallery

Installation and usage

This Julia wrapper exposes all of the functions in the Seaborn API.

You need to have a Python distribution installed with the seaborn Python package. If you do not already have it, run pip install seaborn form the command line.

Download Details: 

Author: JuliaPy
Source Code: https://github.com/JuliaPy/Seaborn.jl 
License: View license

#julia #wrapper #datavisualization