vega_embed_flutter 0.0.1 copy "vega_embed_flutter: ^0.0.1" to clipboard
vega_embed_flutter: ^0.0.1 copied to clipboard

outdated

A Flutter widget to embed vega-lite charts to flutter web. Works only in Flutter web as of now. This could be adapted to be used with flutter webview widget.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:vega_embed_flutter/vega_embed_flutter.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: InteractiveSplom(),
    );
  }
}

class BarChart extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return VegaLiteEmbedder(
      viewFactoryId: 'MyBarChart',
      vegaLiteSchemaLocation: '/assets/vega_schemas/bar_chart.json',
    );
  }
}

class InteractiveSplom extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return VegaLiteEmbedder(
      viewFactoryId: 'MyBarChart',
      vegaLiteSchemaLocation: '/assets/vega_schemas/interactive_splom.json',
    );
  }
}

class InteractiveMultiLineChart extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return VegaLiteEmbedder(
      viewFactoryId: 'InteractiveMultiLine',
      vegaLiteSchemaLocation:
          '/assets/vega_schemas/interactive_multiline_plot.json',
    );
  }
}
5
likes
0
points
18
downloads

Publisher

verified publisherabhilash-chandran.com

Weekly Downloads

A Flutter widget to embed vega-lite charts to flutter web. Works only in Flutter web as of now. This could be adapted to be used with flutter webview widget.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, js

More

Packages that depend on vega_embed_flutter