Fix incorrect imports in lightning docs (#14678)
This commit is contained in:
parent
f3736f642a
commit
14b36f8109
|
@ -56,7 +56,7 @@ First **create a file named app.py** with the app content (in the same folder as
|
|||
|
||||
class HelloComponent(L.LightningFlow):
|
||||
def configure_layout(self):
|
||||
return L.frontend.web.StaticWebFrontend(serve_dir='.')
|
||||
return L.app.frontend.web.StaticWebFrontend(serve_dir='.')
|
||||
|
||||
class LitApp(L.LightningFlow):
|
||||
def __init__(self):
|
||||
|
@ -107,7 +107,7 @@ Give the component an HTML UI, by returning a ``StaticWebFrontend`` object from
|
|||
|
||||
class HelloComponent(L.LightningFlow):
|
||||
def configure_layout(self):
|
||||
return L.frontend.web.StaticWebFrontend(serve_dir='.')
|
||||
return L.app.frontend.web.StaticWebFrontend(serve_dir='.')
|
||||
|
||||
class LitApp(L.LightningFlow):
|
||||
def __init__(self):
|
||||
|
@ -137,7 +137,7 @@ In this case, we render the ``HelloComponent`` UI in the ``home`` tab of the app
|
|||
|
||||
class HelloComponent(L.LightningFlow):
|
||||
def configure_layout(self):
|
||||
return L.frontend.web.StaticWebFrontend(serve_dir='.')
|
||||
return L.app.frontend.web.StaticWebFrontend(serve_dir='.')
|
||||
|
||||
class LitApp(L.LightningFlow):
|
||||
def __init__(self):
|
||||
|
|
|
@ -82,12 +82,12 @@ You can use this single react app for the FULL Lightning app, or you can specify
|
|||
|
||||
class ComponentA(L.LightningFlow):
|
||||
def configure_layout(self):
|
||||
return L.frontend.StaticWebFrontend(Path(__file__).parent / "react_app_1/dist")
|
||||
return L.app.frontend.StaticWebFrontend(Path(__file__).parent / "react_app_1/dist")
|
||||
|
||||
|
||||
class ComponentB(L.LightningFlow):
|
||||
def configure_layout(self):
|
||||
return L.frontend.StaticWebFrontend(Path(__file__).parent / "react_app_2/dist")
|
||||
return L.app.frontend.StaticWebFrontend(Path(__file__).parent / "react_app_2/dist")
|
||||
|
||||
|
||||
class HelloLitReact(L.LightningFlow):
|
||||
|
|
|
@ -46,7 +46,7 @@ First **create a file named app.py** with the app content:
|
|||
|
||||
class LitStreamlit(L.LightningFlow):
|
||||
def configure_layout(self):
|
||||
return L.frontend.StreamlitFrontend(render_fn=your_streamlit_app)
|
||||
return L.app.frontend.StreamlitFrontend(render_fn=your_streamlit_app)
|
||||
|
||||
class LitApp(L.LightningFlow):
|
||||
def __init__(self):
|
||||
|
@ -125,7 +125,7 @@ the ``configure_layout`` method of the Lightning component you want to connect t
|
|||
|
||||
class LitStreamlit(L.LightningFlow):
|
||||
def configure_layout(self):
|
||||
return L.frontend.StreamlitFrontend(render_fn=your_streamlit_app)
|
||||
return L.app.frontend.StreamlitFrontend(render_fn=your_streamlit_app)
|
||||
|
||||
class LitApp(L.LightningFlow):
|
||||
def __init__(self):
|
||||
|
@ -160,7 +160,7 @@ In this case, we render the ``LitStreamlit`` UI in the ``home`` tab of the appli
|
|||
|
||||
class LitStreamlit(L.LightningFlow):
|
||||
def configure_layout(self):
|
||||
return L.frontend.StreamlitFrontend(render_fn=your_streamlit_app)
|
||||
return L.app.frontend.StreamlitFrontend(render_fn=your_streamlit_app)
|
||||
|
||||
class LitApp(L.LightningFlow):
|
||||
def __init__(self):
|
||||
|
|
|
@ -35,7 +35,7 @@ For example, here we increase the count variable of the Lightning Component ever
|
|||
self.count = 0
|
||||
|
||||
def configure_layout(self):
|
||||
return L.frontend.StreamlitFrontend(render_fn=your_streamlit_app)
|
||||
return L.app.frontend.StreamlitFrontend(render_fn=your_streamlit_app)
|
||||
|
||||
|
||||
class LitApp(L.LightningFlow):
|
||||
|
@ -81,7 +81,7 @@ In this example we update the value of the counter from the component:
|
|||
self.count += 1
|
||||
|
||||
def configure_layout(self):
|
||||
return L.frontend.StreamlitFrontend(render_fn=your_streamlit_app)
|
||||
return L.app.frontend.StreamlitFrontend(render_fn=your_streamlit_app)
|
||||
|
||||
|
||||
class LitApp(L.LightningFlow):
|
||||
|
|
|
@ -32,12 +32,11 @@ To *connect* this user interface to the Component, define the configure_layout m
|
|||
:emphasize-lines: 5, 6
|
||||
|
||||
import lightning as L
|
||||
from lightning_app.frontend.web import StaticWebFrontend
|
||||
|
||||
|
||||
class LitHTMLComponent(L.LightningFlow):
|
||||
def configure_layout(self):
|
||||
return StaticWebFrontend(serve_dir="path/to/folder/with/index.html/inside")
|
||||
return L.app.frontend.StaticWebFrontend(serve_dir="path/to/folder/with/index.html/inside")
|
||||
|
||||
Finally, route the Component's UI through the root Component's **configure_layout** method:
|
||||
|
||||
|
@ -50,7 +49,7 @@ Finally, route the Component's UI through the root Component's **configure_layou
|
|||
|
||||
class LitHTMLComponent(L.LightningFlow):
|
||||
def configure_layout(self):
|
||||
return L.frontend.web.StaticWebFrontend(serve_dir="path/to/folder/with/index.html/inside")
|
||||
return L.app.frontend.web.StaticWebFrontend(serve_dir="path/to/folder/with/index.html/inside")
|
||||
|
||||
|
||||
class LitApp(L.LightningFlow):
|
||||
|
|
Loading…
Reference in New Issue