Skip to content

Commit

Permalink
Merge pull request #258 from JohanMabille/fix_ci
Browse files Browse the repository at this point in the history
Updated CI images and cmake minimal version
  • Loading branch information
JohanMabille committed Nov 9, 2023
2 parents def32b5 + 6229edd commit 5669080
Show file tree
Hide file tree
Showing 6 changed files with 1,806 additions and 1,802 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/main.yml
Expand Up @@ -8,6 +8,10 @@ on:
branches:
- main

defaults:
run:
shell: bash -l {0}

jobs:

pre-commit:
Expand All @@ -22,13 +26,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11]
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]

steps:
- uses: actions/checkout@v3

- name: Install mamba
uses: mamba-org/provision-with-micromamba@v14
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: environment-dev.yml
environment-name: xwidgets
Expand Down
98 changes: 49 additions & 49 deletions docs/source/embed_widgets/xleaflet_example.ipynb
@@ -1,52 +1,52 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#include \"xwidgets/xhtml.hpp\"\n",
"\n",
"#include \"xleaflet/xmap.hpp\"\n",
"#include \"xleaflet/xmarker.hpp\"\n",
"\n",
"auto html = xw::html::initialize()\n",
" .value(\"Hello from an <b>xwidget</b> in an <b>xmarker</b>!\")\n",
" .finalize();\n",
"\n",
"std::array<double, 2> center = {52.204793, 360.121558};\n",
"\n",
"auto map = xlf::map::initialize()\n",
" .center(center)\n",
" .zoom(15)\n",
" .finalize();\n",
"\n",
"auto marker = xlf::marker::initialize()\n",
" .location(center)\n",
" .draggable(false)\n",
" .popup(html)\n",
" .finalize();\n",
"map.add_layer(marker);\n",
"\n",
"map"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "C++14",
"language": "C++14",
"name": "xeus-cling-cpp14"
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#include \"xwidgets/xhtml.hpp\"\n",
"\n",
"#include \"xleaflet/xmap.hpp\"\n",
"#include \"xleaflet/xmarker.hpp\"\n",
"\n",
"auto html = xw::html::initialize()\n",
" .value(\"Hello from an <b>xwidget</b> in an <b>xmarker</b>!\")\n",
" .finalize();\n",
"\n",
"std::array<double, 2> center = {52.204793, 360.121558};\n",
"\n",
"auto map = xlf::map::initialize()\n",
" .center(center)\n",
" .zoom(15)\n",
" .finalize();\n",
"\n",
"auto marker = xlf::marker::initialize()\n",
" .location(center)\n",
" .draggable(false)\n",
" .popup(html)\n",
" .finalize();\n",
"map.add_layer(marker);\n",
"\n",
"map"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "C++14",
"language": "C++14",
"name": "xeus-cling-cpp14"
},
"language_info": {
"version": "14",
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++"
}
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++",
"version": "14"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat": 4,
"nbformat_minor": 2
}
152 changes: 76 additions & 76 deletions docs/source/embed_widgets/xplot_example.ipynb
@@ -1,79 +1,79 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#include <algorithm>\n",
"#include <random>\n",
"#include <vector>\n",
"\n",
"#include \"xplot/xfigure.hpp\"\n",
"#include \"xplot/xmarks.hpp\"\n",
"#include \"xplot/xaxes.hpp\"\n",
"\n",
"auto randn(std::size_t n)\n",
"{\n",
" std::vector<double> output(n);\n",
" std::random_device rd;\n",
" std::mt19937 gen(rd());\n",
" std::normal_distribution<> dis(5, 2);\n",
"\n",
" std::for_each(output.begin(), output.end(), [&dis, &gen](auto& v){v = dis(gen);});\n",
"\n",
" return output;\n",
"}\n",
"\n",
"std::size_t data_size = 200;\n",
"std::vector<double> data_x(data_size);\n",
"std::iota(data_x.begin(), data_x.end(), 0);\n",
"std::vector<double> data_y = randn(data_size);\n",
"std::vector<double> data_c = randn(data_size);\n",
"\n",
"xpl::linear_scale scale_x, scale_y;\n",
"xpl::linear_scale scale_size;\n",
"\n",
"auto scatter = xpl::scatter::initialize(scale_x, scale_y, scale_size)\n",
" .x(data_x)\n",
" .y(data_y)\n",
" .size(data_c)\n",
" .stroke(\"black\")\n",
" .default_size(128)\n",
" .enable_move(true)\n",
" .colors(std::vector<xtl::xoptional<std::string>>{\"orangered\"})\n",
" .finalize();\n",
"\n",
"xpl::axis axis_x(scale_x), axis_y(scale_y);\n",
"axis_x.label = \"x\";\n",
"axis_y.label = \"y\";\n",
"axis_y.orientation = \"vertical\";\n",
"axis_y.side = \"left\";\n",
"\n",
"xpl::figure fig;\n",
"fig.padding_x = 0.025;\n",
"fig.add_mark(scatter);\n",
"fig.add_axis(axis_x);\n",
"fig.add_axis(axis_y);\n",
"fig"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "C++14",
"language": "C++14",
"name": "xeus-cling-cpp14"
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#include <algorithm>\n",
"#include <random>\n",
"#include <vector>\n",
"\n",
"#include \"xplot/xfigure.hpp\"\n",
"#include \"xplot/xmarks.hpp\"\n",
"#include \"xplot/xaxes.hpp\"\n",
"\n",
"auto randn(std::size_t n)\n",
"{\n",
" std::vector<double> output(n);\n",
" std::random_device rd;\n",
" std::mt19937 gen(rd());\n",
" std::normal_distribution<> dis(5, 2);\n",
"\n",
" std::for_each(output.begin(), output.end(), [&dis, &gen](auto& v){v = dis(gen);});\n",
"\n",
" return output;\n",
"}\n",
"\n",
"std::size_t data_size = 200;\n",
"std::vector<double> data_x(data_size);\n",
"std::iota(data_x.begin(), data_x.end(), 0);\n",
"std::vector<double> data_y = randn(data_size);\n",
"std::vector<double> data_c = randn(data_size);\n",
"\n",
"xpl::linear_scale scale_x, scale_y;\n",
"xpl::linear_scale scale_size;\n",
"\n",
"auto scatter = xpl::scatter::initialize(scale_x, scale_y, scale_size)\n",
" .x(data_x)\n",
" .y(data_y)\n",
" .size(data_c)\n",
" .stroke(\"black\")\n",
" .default_size(128)\n",
" .enable_move(true)\n",
" .colors(std::vector<xtl::xoptional<std::string>>{\"orangered\"})\n",
" .finalize();\n",
"\n",
"xpl::axis axis_x(scale_x), axis_y(scale_y);\n",
"axis_x.label = \"x\";\n",
"axis_y.label = \"y\";\n",
"axis_y.orientation = \"vertical\";\n",
"axis_y.side = \"left\";\n",
"\n",
"xpl::figure fig;\n",
"fig.padding_x = 0.025;\n",
"fig.add_mark(scatter);\n",
"fig.add_axis(axis_x);\n",
"fig.add_axis(axis_y);\n",
"fig"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "C++14",
"language": "C++14",
"name": "xeus-cling-cpp14"
},
"language_info": {
"version": "14",
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++"
}
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++",
"version": "14"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat": 4,
"nbformat_minor": 2
}
4 changes: 2 additions & 2 deletions environment-dev.yml
Expand Up @@ -7,10 +7,10 @@ dependencies:
- cxx-compiler
- ninja
# Host dependencies
- xeus=3.0.3
- xeus<4
- cppzmq
- xproperty=0.11.0
- nlohmann_json=3.9.1
- nlohmann_json
# Test dependencies
- doctest >= 2.4.6
- json_schema_validator
Expand Down

0 comments on commit 5669080

Please sign in to comment.