パッケージ、リポジトリ、アプリカテゴリを検索

fl_heatmap のカバー
パッケージ詳細v0.4.6

fl_heatmap

さまざまなスタイリングオプションを備えたFlutterアプリ用のヒートマップウィジェット。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
3510
いいね数
56
Pub ポイント
160

パッケージをインストール

flutter pub add fl_heatmap

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

fl_heatmap は、2次元のデータを可視化するためのカスタマイズ可能なヒートマップウィジェットを提供するFlutterパッケージです。色調、セルサイズ、ラベルカスタマイズなど、さまざまなスタイルオプションをサポートしており、データセット内の密度や頻度パターンを表示するのに最適です。複数のプラットフォームでFlutterアプリにスムーズに統合され、滑らかなレンダリングと応答性のある動作を提供します。特に分析ダッシュボード、地理情報の可視化、時系列ヒートマップに有用です。パフォーマンスを重視して構築されており、大規模なデータセットを効率的に処理しつつ、洗練された直感的なAPIを維持しています。

用途

  • データ密度の可視化
  • 分析ダッシュボード
  • 地理空間データ表現
  • 時系列ヒートマップ
  • ユーザー活動の追跡

主な機能

  • カスタマイズ可能なカラースキーマ
  • 設定可能なセルサイズ
  • ラベルおよびツールチップのサポート
  • レスポンシブデザイン
  • 大規模データセットの効率的なレンダリング
  • クロスプラットフォーム互換性

適している対象

  • データ可視化機能を構築している開発者
  • 分析ダッシュボードを作成するチーム
  • データ内のパターン認識を必要とするアプリ
  • インタラクティブチャートを備えた教育ツール
  • 空間的または時間的なデータを含むプロジェクト

注意事項

  • 2次元データ構造の理解が必要です
  • 非常に大きなデータセットではパフォーマンスが異なる場合があります
  • ツールチップ以外の組み込みインタラクティビティは限定的
  • スタイリングオプションは最適な外観を得るために慎重に設定する必要があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

fl_heatmap

A heatmap widget for Flutter apps.

heatmap electricity consumption

heatmap water consumption

Usage

1 - Depend on it

Add it to your package's pubspec.yaml file

dependencies:
  fl_heatmap: ^0.1.0
2 - Install it

Install packages from the command line

flutter packages get
3 - Use it

This is an example for the months of four years:

import 'package:fl_heatmap/fl_heatmap.dart';

class _ExampleState extends State<ExampleApp> {
  HeatmapItem? selectedItem;

  late HeatmapData heatmapData;

  @override
  void initState() {
    _initExampleData();
    super.initState();
  }

  void _initExampleData() {
    const rows = [
      '2022',
      '2021',
      '2020',
      '2019',
    ];
    const columns = [
      'Jan',
      'Feb',
      'Mär',
      'Apr',
      'Mai',
      'Jun',
      'Jul',
      'Aug',
      'Sep',
      'Okt',
      'Nov',
      'Dez',
    ];
    final r = Random();
    const String unit = 'kWh';
    heatmapData = HeatmapData(rows: rows, columns: columns, items: [
      for (int row = 0; row < rows.length; row++)
        for (int col = 0; col < columns.length; col++)
          HeatmapItem(
              value: r.nextDouble() * 6,
              unit: unit,
              xAxisLabel: columns[col],
              yAxisLabel: rows[row]),
    ]);
  }

  @override
  Widget build(BuildContext context) {
    final title = selectedItem != null
        ? '${selectedItem!.value.toStringAsFixed(2)} ${selectedItem!.unit}'
        : '--- ${heatmapData.items.first.unit}';
    final subtitle = selectedItem != null
        ? '${selectedItem!.xAxisLabel} ${selectedItem!.yAxisLabel}'
        : '---';
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Heatmap plugin example app'),
        ),
        body: SingleChildScrollView(
          child: Column(
            children: [
              const SizedBox(height: 16),
              Text(title, textScaleFactor: 1.4),
              Text(subtitle),
              const SizedBox(height: 8),
              Heatmap(
                  onItemSelectedListener: (HeatmapItem? selectedItem) {
                    debugPrint(
                        'Item ${selectedItem?.yAxisLabel}/${selectedItem?.xAxisLabel} with value ${selectedItem?.value} selected');
                    setState(() {
                      this.selectedItem = selectedItem;
                    });
                  },
                  rowsVisible: 5, // Only the first 5 rows are visible
                  heatmapData: heatmapData)
            ],
          ),
        ),
      ),
    );
  }
}

If necessary you can inherit from HeatmapItem and attach some payload, e.g. the electricity costs for the consumption:

class CustomHeatmapItem extends HeatmapItem {
  CustomHeatmapItem(
      {required this.costs,
      required double value,
      required String unit,
      required String xAxisLabel,
      required String yAxisLabel})
      : super(
            value: value,
            unit: unit,
            xAxisLabel: xAxisLabel,
            yAxisLabel: yAxisLabel);
  
  final double costs;
}

Features

  • Supporting custom color schemes with dynamic size or use predefined color palettes such as colorPaletteTemperature, colorPaletteRed, colorPaletteBlue.
  • x- and y-axis labels are completely dynamic
  • Do not show the x-axis/y-axis labels if necessary
  • Detect clicks on cells and get back the data item to show detailed information about the cell
  • Use different styles for the cells if necessary
  • Show only the first lines and user can request to show all

Apps using this plugin

EHW+ Your app?
EHW+ ...

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。