Open SylvainCorlay opened 6 years ago
The current schema spec is a markdown style.
Maybe we could decide on a JSON spec instead of markdown, which we could generate for a list of types of widgets. https://github.com/jupyter-widgets/ipywidgets/issues/1979
A simple means to get the default serialized state of e.g. Slider is:
#include <iostream>
#include "xwidgets/xslider.hpp"
// instantiate slider
xw::slider<double> slider;
// retrieve default state
xeus::xjson state; xeus::buffer_sequence buffers;
slider.serialize_state(state, buffers);
// compare state with reference model
std::cout << state << std::endl;
from ipywidgets import IntSlider
s = IntSlider()
s.get_state()
template <class WT>
void test_widget_schema(std::string& python_widget_type, std::string& python_widget_module)
{
// instantiate python widget
// use pybind11
// get_state();
auto s = WT();
// serialize_state();
};
It would be interesting to test xwidgets's properties against ipywidget's schemas.