Skip to content

Demonstrates how to interact with D3.js from Phoenix LiveView

Notifications You must be signed in to change notification settings

maikroempagel/phoenix_liveview_d3js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

This little project demonstrates how to interact with D3.js from a Phoenix LiveView using client hooks.

Currently a simple circle object is added to the LiveView dynamically. The color of the circle changes by periodically pushing a random color to the client.

More examples might be added in the future.

How the project was created:

mix phx.new phoenix_liveview_d3js --no-mailer --no-dashboard --no-ecto --live --module D3Demo

cd phoenix_liveview_d3js/assets

npm install d3 --save

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Start Phoenix endpoint with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

Learn more