Skip to content

Commit

Permalink
Removed xtl
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanMabille committed Jun 5, 2024
1 parent 5030f60 commit 8611fde
Show file tree
Hide file tree
Showing 134 changed files with 1,831 additions and 1,739 deletions.
9 changes: 1 addition & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ OPTION(XVEGA_BUILD_TESTS "xvega test suite" OFF)
# Dependencies
# ============

set(xtl_REQUIRED_VERSION 0.7.0)
find_package(xtl ${xtl_REQUIRED_VERSION} REQUIRED)
message(STATUS "Found xtl: ${xtl_INCLUDE_DIRS}/xtl")

set(xproperty_REQUIRED_VERSION 0.12.0)
find_package(xproperty ${xproperty_REQUIRED_VERSION} REQUIRED)
message(STATUS "Found xproperty: ${xproperty_INCLUDE_DIRS}/xproperty")
Expand Down Expand Up @@ -425,10 +421,7 @@ macro(xvega_create_target target_name linkage output_name)
$<BUILD_INTERFACE:${XVEGA_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)

target_link_libraries(${target_name} PUBLIC
xtl
xproperty
)
target_link_libraries(${target_name} PUBLIC xproperty)
endmacro()

# xvega
Expand Down
16 changes: 9 additions & 7 deletions include/xvega/grammar/chart.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#ifndef XVEGA_CHART_HPP
#define XVEGA_CHART_HPP

#include <optional>
#include <variant>
#include <vector>

#include "../xvega_config.hpp"
Expand Down Expand Up @@ -35,27 +37,27 @@ namespace nl = nlohmann;

namespace xv
{
using data_type = xtl::variant<
using data_type = std::variant<
named_data, inline_data, url_data,
sequence_generator, sphere_generator, graticule_generator,
data_frame>;

using marks_type = xany<mark>;
using selection_type = xany<selection>;
using transform_type = xany<transformation>;
using title_type = xtl::variant<std::string, Title>;
using title_type = std::variant<std::string, Title>;

struct Chart : public xp::xobserved<Chart>
{
XPROPERTY(data_type, Chart, data);
XPROPERTY(marks_type, Chart, mark);
XPROPERTY(xtl::xoptional<Encodings>, Chart, encoding);
XPROPERTY(std::optional<Encodings>, Chart, encoding);
XPROPERTY(std::vector<selection_type>, Chart, selections);
XPROPERTY(std::vector<transform_type>, Chart, transformations);
XPROPERTY(xtl::xoptional<double>, Chart, width);
XPROPERTY(xtl::xoptional<double>, Chart, height);
XPROPERTY(xtl::xoptional<Config>, Chart, config);
XPROPERTY(xtl::xoptional<title_type>, Chart, title);
XPROPERTY(std::optional<double>, Chart, width);
XPROPERTY(std::optional<double>, Chart, height);
XPROPERTY(std::optional<Config>, Chart, config);
XPROPERTY(std::optional<title_type>, Chart, title);
};

nl::json XVEGA_API mime_bundle_repr(const Chart& v);
Expand Down
129 changes: 66 additions & 63 deletions include/xvega/grammar/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#ifndef XVEGA_CONFIGURATIONS_HPP
#define XVEGA_CONFIGURATIONS_HPP

#include <optional>
#include <variant>

#include "xproperty/xobserved.hpp"

#include "../xvega_config.hpp"
Expand Down Expand Up @@ -37,72 +40,72 @@

namespace xv
{
using autosize_type = xtl::variant<std::string, auto_size_params>;
using autosize_type = std::variant<std::string, auto_size_params>;

struct Config : public xp::xobserved<Config>
{
XPROPERTY(xtl::xoptional<area_config>, Config, area);
XPROPERTY(xtl::xoptional<autosize_type>, Config, autosize);
XPROPERTY(xtl::xoptional<axis_config>, Config, axis);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisBand);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisBottom);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisDiscrete);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisLeft);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisPoint);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisQuantitative);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisRight);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisTemporal);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisTop);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisX);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisXBand);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisXDiscrete);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisXPoint);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisXQuantitative);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisXTemporal);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisY);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisYBand);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisYDiscrete);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisYPoint);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisYQuantitative);
XPROPERTY(xtl::xoptional<axis_config>, Config, axisYTemporal);
XPROPERTY(xtl::xoptional<std::string>, Config, background);
XPROPERTY(xtl::xoptional<bar_config>, Config, bar);
XPROPERTY(xtl::xoptional<box_plot_config>, Config, boxplot);
XPROPERTY(xtl::xoptional<mark_config>, Config, circle);
XPROPERTY(xtl::xoptional<composition_config>, Config, concat);
XPROPERTY(xtl::xoptional<std::string>, Config, countTitle);
XPROPERTY(xtl::xoptional<error_band_config>, Config, errorband);
XPROPERTY(xtl::xoptional<error_bar_config>, Config, errorbar);
XPROPERTY(xtl::xoptional<composition_config>, Config, facet);
XPROPERTY(xtl::xoptional<std::string>, Config, fieldTitle);
XPROPERTY(xtl::xoptional<std::string>, Config, font);
XPROPERTY(xtl::xoptional<mark_config>, Config, geoshape);
XPROPERTY(xtl::xoptional<header_config>, Config, header);
XPROPERTY(xtl::xoptional<header_config>, Config, headerColumn);
XPROPERTY(xtl::xoptional<header_config>, Config, headerFacet);
XPROPERTY(xtl::xoptional<header_config>, Config, headerRow);
XPROPERTY(xtl::xoptional<rect_config>, Config, image);
XPROPERTY(xtl::xoptional<legend_config>, Config, legend);
XPROPERTY(xtl::xoptional<line_config>, Config, line);
XPROPERTY(xtl::xoptional<std::string>, Config, lineBreak);
XPROPERTY(xtl::xoptional<mark_config>, Config, mark);
XPROPERTY(xtl::xoptional<std::string>, Config, numberFormat);
XPROPERTY(xtl::xoptional<num_object_type>, Config, padding);
XPROPERTY(xtl::xoptional<mark_config>, Config, point);
XPROPERTY(xtl::xoptional<projection_config>, Config, projection);
XPROPERTY(xtl::xoptional<range_config>, Config, range);
XPROPERTY(xtl::xoptional<rect_config>, Config, rect);
XPROPERTY(xtl::xoptional<mark_config>, Config, rule);
XPROPERTY(xtl::xoptional<scale_config>, Config, scale);
XPROPERTY(xtl::xoptional<selection_config>, Config, selection);
XPROPERTY(xtl::xoptional<mark_config>, Config, square);
XPROPERTY(xtl::xoptional<style_config_index>, Config, style);
XPROPERTY(xtl::xoptional<mark_config>, Config, text);
XPROPERTY(xtl::xoptional<tick_config>, Config, tick);
XPROPERTY(xtl::xoptional<std::string>, Config, timeFormat);
XPROPERTY(xtl::xoptional<title_config>, Config, title);
XPROPERTY(xtl::xoptional<line_config>, Config, trail);
XPROPERTY(xtl::xoptional<view_config>, Config, view);
XPROPERTY(std::optional<area_config>, Config, area);
XPROPERTY(std::optional<autosize_type>, Config, autosize);
XPROPERTY(std::optional<axis_config>, Config, axis);
XPROPERTY(std::optional<axis_config>, Config, axisBand);
XPROPERTY(std::optional<axis_config>, Config, axisBottom);
XPROPERTY(std::optional<axis_config>, Config, axisDiscrete);
XPROPERTY(std::optional<axis_config>, Config, axisLeft);
XPROPERTY(std::optional<axis_config>, Config, axisPoint);
XPROPERTY(std::optional<axis_config>, Config, axisQuantitative);
XPROPERTY(std::optional<axis_config>, Config, axisRight);
XPROPERTY(std::optional<axis_config>, Config, axisTemporal);
XPROPERTY(std::optional<axis_config>, Config, axisTop);
XPROPERTY(std::optional<axis_config>, Config, axisX);
XPROPERTY(std::optional<axis_config>, Config, axisXBand);
XPROPERTY(std::optional<axis_config>, Config, axisXDiscrete);
XPROPERTY(std::optional<axis_config>, Config, axisXPoint);
XPROPERTY(std::optional<axis_config>, Config, axisXQuantitative);
XPROPERTY(std::optional<axis_config>, Config, axisXTemporal);
XPROPERTY(std::optional<axis_config>, Config, axisY);
XPROPERTY(std::optional<axis_config>, Config, axisYBand);
XPROPERTY(std::optional<axis_config>, Config, axisYDiscrete);
XPROPERTY(std::optional<axis_config>, Config, axisYPoint);
XPROPERTY(std::optional<axis_config>, Config, axisYQuantitative);
XPROPERTY(std::optional<axis_config>, Config, axisYTemporal);
XPROPERTY(std::optional<std::string>, Config, background);
XPROPERTY(std::optional<bar_config>, Config, bar);
XPROPERTY(std::optional<box_plot_config>, Config, boxplot);
XPROPERTY(std::optional<mark_config>, Config, circle);
XPROPERTY(std::optional<composition_config>, Config, concat);
XPROPERTY(std::optional<std::string>, Config, countTitle);
XPROPERTY(std::optional<error_band_config>, Config, errorband);
XPROPERTY(std::optional<error_bar_config>, Config, errorbar);
XPROPERTY(std::optional<composition_config>, Config, facet);
XPROPERTY(std::optional<std::string>, Config, fieldTitle);
XPROPERTY(std::optional<std::string>, Config, font);
XPROPERTY(std::optional<mark_config>, Config, geoshape);
XPROPERTY(std::optional<header_config>, Config, header);
XPROPERTY(std::optional<header_config>, Config, headerColumn);
XPROPERTY(std::optional<header_config>, Config, headerFacet);
XPROPERTY(std::optional<header_config>, Config, headerRow);
XPROPERTY(std::optional<rect_config>, Config, image);
XPROPERTY(std::optional<legend_config>, Config, legend);
XPROPERTY(std::optional<line_config>, Config, line);
XPROPERTY(std::optional<std::string>, Config, lineBreak);
XPROPERTY(std::optional<mark_config>, Config, mark);
XPROPERTY(std::optional<std::string>, Config, numberFormat);
XPROPERTY(std::optional<num_object_type>, Config, padding);
XPROPERTY(std::optional<mark_config>, Config, point);
XPROPERTY(std::optional<projection_config>, Config, projection);
XPROPERTY(std::optional<range_config>, Config, range);
XPROPERTY(std::optional<rect_config>, Config, rect);
XPROPERTY(std::optional<mark_config>, Config, rule);
XPROPERTY(std::optional<scale_config>, Config, scale);
XPROPERTY(std::optional<selection_config>, Config, selection);
XPROPERTY(std::optional<mark_config>, Config, square);
XPROPERTY(std::optional<style_config_index>, Config, style);
XPROPERTY(std::optional<mark_config>, Config, text);
XPROPERTY(std::optional<tick_config>, Config, tick);
XPROPERTY(std::optional<std::string>, Config, timeFormat);
XPROPERTY(std::optional<title_config>, Config, title);
XPROPERTY(std::optional<line_config>, Config, trail);
XPROPERTY(std::optional<view_config>, Config, view);
};

XVEGA_API void to_json(nl::json& j, const Config& data);
Expand Down
10 changes: 6 additions & 4 deletions include/xvega/grammar/config/area_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@
#ifndef XVEGA_AREA_CONFIG_HPP
#define XVEGA_AREA_CONFIG_HPP

#include <variant>

#include "./base_config.hpp"
#include "./overlay_mark_def.hpp"

namespace xv
{
using bool_overlay_mark_def_type = xtl::variant<bool, overlay_mark_def>;
using bool_overlay_mark_def_string_type = xtl::variant<bool, overlay_mark_def, std::string>;
using bool_overlay_mark_def_type = std::variant<bool, overlay_mark_def>;
using bool_overlay_mark_def_string_type = std::variant<bool, overlay_mark_def, std::string>;

struct area_config : public base_config<area_config>
{
XPROPERTY(xtl::xoptional<bool_overlay_mark_def_type>, area_config, line);
XPROPERTY(xtl::xoptional<bool_overlay_mark_def_string_type>, area_config, point);
XPROPERTY(std::optional<bool_overlay_mark_def_type>, area_config, line);
XPROPERTY(std::optional<bool_overlay_mark_def_string_type>, area_config, point);
};

XVEGA_API void to_json(nl::json&, const area_config&);
Expand Down
8 changes: 5 additions & 3 deletions include/xvega/grammar/config/auto_size_params.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#ifndef XVEGA_AUTO_SIZE_PARAMS_HPP
#define XVEGA_AUTO_SIZE_PARAMS_HPP

#include <optional>

#include "xproperty/xobserved.hpp"

#include "../../xvega_config.hpp"
Expand All @@ -16,9 +18,9 @@ namespace xv
{
struct auto_size_params : public xp::xobserved<auto_size_params>
{
XPROPERTY(xtl::xoptional<std::string>, auto_size_params, contains);
XPROPERTY(xtl::xoptional<bool>, auto_size_params, resize);
XPROPERTY(xtl::xoptional<std::string>, auto_size_params, type);
XPROPERTY(std::optional<std::string>, auto_size_params, contains);
XPROPERTY(std::optional<bool>, auto_size_params, resize);
XPROPERTY(std::optional<std::string>, auto_size_params, type);
};

XVEGA_API void to_json(nl::json& j, const auto_size_params& data);
Expand Down
Loading

0 comments on commit 8611fde

Please sign in to comment.