hugobarauna commited on
Commit
a7504c6
1 Parent(s): 8ca62c5

Change image input configs

Browse files
Files changed (1) hide show
  1. public-apps/kino_ui_widgets.livemd +15 -4
public-apps/kino_ui_widgets.livemd CHANGED
@@ -1,4 +1,4 @@
1
- <!-- livebook:{"app_settings":{"access_type":"public","auto_shutdown_ms":5000,"multi_session":true,"output_type":"rich","show_source":true,"slug":"kino-widgets"}} -->
2
 
3
  # Kino UI widgets
4
 
@@ -12,13 +12,24 @@ Mix.install([
12
 
13
  ````elixir
14
  defmodule Helpers do
15
- def display_widget_demo("select") do
16
  code =
17
  quote do
18
- Kino.Input.select("select", en: "English", fr: "Français")
19
  end
20
 
21
- markdown = build_code_sample("select", code)
 
 
 
 
 
 
 
 
 
 
 
22
 
23
  render_input_demo(markdown, code)
24
  end
 
1
+ <!-- livebook:{"app_settings":{"access_type":"public","auto_shutdown_ms":3600000,"output_type":"rich","show_source":true,"slug":"kino-widgets"}} -->
2
 
3
  # Kino UI widgets
4
 
 
12
 
13
  ````elixir
14
  defmodule Helpers do
15
+ def display_widget_demo(function_name) when function_name == "select" do
16
  code =
17
  quote do
18
+ Kino.Input.select(unquote(function_name), en: "English", fr: "Français")
19
  end
20
 
21
+ markdown = build_code_sample(function_name, code)
22
+
23
+ render_input_demo(markdown, code)
24
+ end
25
+
26
+ def display_widget_demo(function_name) when function_name == "image" do
27
+ code =
28
+ quote do
29
+ Kino.Input.image(unquote(function_name), format: :png, width: 500, height: 500)
30
+ end
31
+
32
+ markdown = build_code_sample(function_name, code)
33
 
34
  render_input_demo(markdown, code)
35
  end