Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Trying to use plugins in fullCalendar #314

Answered by rmorshea
nghenzi asked this question in Question
Discussion options

Hi !! thanks for this amazing package. I am trying to use the fullCalendar library, but I am not sure how to use the plugins which give the view of the calendar. The page shows nothing

import idom
from idom.server.sanic import PerClientStateServer
from sanic import Sanic
dg = idom.install("@fullcalendar/daygrid", fallback="loading...")
fc = idom.install("@fullcalendar/react", fallback="loading...")
app= Sanic(name='res')
@idom.component
def View(self):
 return idom.component(
 lambda: fc.Calendar({'plugins':[dg.DayGrid], 
 'weekends':False})
 )
per_client_state = PerClientStateServer(View)
per_client_state.register(app)
app.run("localhost", 5002)

thanks for the responses,
Best regards,
Nestor.

You must be logged in to vote

This is related to a discussion here about Material UI. Unfortunately, IDOM only understands how to render components that come from Javascript packages. Any props you pass to those components are limited to standard JSON serializable data.

It is curious that you aren't seeing any errors though. We should definitely be logging something because this should be failing to serialize data.

Replies: 2 comments 3 replies

Comment options

This is related to a discussion here about Material UI. Unfortunately, IDOM only understands how to render components that come from Javascript packages. Any props you pass to those components are limited to standard JSON serializable data.

It is curious that you aren't seeing any errors though. We should definitely be logging something because this should be failing to serialize data.

You must be logged in to vote
3 replies
Comment options

Turns out there's a bug that's causing logs to be suppressed #315

But there's still some weirdness that's preventing the error from being surfaced... looking into that.

Comment options

@nghenzi the latest release of IDOM now produces useful error logs given the code above:

[2021年03月04日 21:40:10 -0800] [1913608] [INFO] Goin' Fast @ http://localhost:5002
[2021年03月04日 21:40:10 -0800] [1913608] [INFO] Starting worker [1913608]
[2021年03月04日 21:40:13 -0800] - (sanic.access)[INFO][127.0.0.1:36552]: GET http://localhost:5002/ 302 0
[2021年03月04日 21:40:13 -0800] - (sanic.access)[INFO][127.0.0.1:36552]: GET http://localhost:5002/client/index.html 200 403
[2021年03月04日 21:40:13 -0800] - (sanic.access)[INFO][127.0.0.1:36552]: GET http://localhost:5002/client/index.js 200 982
[2021年03月04日 21:40:13 -0800] - (sanic.access)[INFO][127.0.0.1:36552]: GET http://localhost:5002/client/web_modules/idom-client-react.js 200 39261
[2021年03月04日 21:40:13 -0800] - (sanic.access)[INFO][127.0.0.1:36552]: GET http://localhost:5002/client/web_modules/common/index-6ed86a98.js 200 9836
[2021年03月04日 21:40:13 -0800] - (sanic.access)[INFO][127.0.0.1:36560]: GET http://localhost:5002/client/web_modules/htm.js 200 1220
[2021年03月04日 21:40:13 -0800] - (sanic.access)[INFO][127.0.0.1:36556]: GET http://localhost:5002/client/web_modules/common/index-21e68f69.js 200 125579
2021年03月04日T21:40:13-0800 | ERROR | idom.core.layout | Failed to render View(...)
Traceback (most recent call last):
 File "/home/ryan/.pyenv/versions/main/lib/python3.9/site-packages/idom/core/layout.py", line 159, in _render_component
 raw_model = component_state.component_obj.render()
 File "/home/ryan/.pyenv/versions/main/lib/python3.9/site-packages/idom/core/component.py", line 58, in render
 return self._function(*self._args, **self._kwargs)
TypeError: View() missing 1 required positional argument: 'self'
[2021年03月04日 21:40:13 -0800] - (sanic.access)[INFO][127.0.0.1:36556]: GET http://localhost:5002/client/idom-logo-square-small.svg 200 2283

In addition to the issue I called out above there's some others that, even without that, prevent this code from running. Let me know if you'd like more help debugging this.

Comment options

Thanks ! I am looking at the custom component, as soon as I advance with something significant or I am very stuck I will comment again here.

Answer selected by nghenzi
Comment options

Thanks for your quick response ! I'll take a look at the custom component option.

I think that pyecharts solve the problem of serializing JS objects, but I can not find now how they do it.

Anything I will come back here with questions.

Best regards,
N

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /