From 3be0359f57fa92745aeb2d20fd24e432cb25e454 Mon Sep 17 00:00:00 2001 From: simaQ Date: Mon, 11 Feb 2019 16:45:44 +0800 Subject: [PATCH] fix: legend filter should work during pan or pinch. Closed #467 --- src/plugin/filter.js | 2 +- test/bug/issue-467-spec.js | 60 ++ test/fixtures/cereal.json | 1259 ++++++++++++++++++++++++++++++++++++ 3 files changed, 1320 insertions(+), 1 deletion(-) create mode 100644 test/bug/issue-467-spec.js create mode 100644 test/fixtures/cereal.json diff --git a/src/plugin/filter.js b/src/plugin/filter.js index 4ffa144d4..f8e77c7f7 100644 --- a/src/plugin/filter.js +++ b/src/plugin/filter.js @@ -8,7 +8,7 @@ module.exports = { beforeGeomInit(chart) { chart.set('limitInPlot', true); - const data = chart.get('data'); + const data = chart.get('filteredData'); const colDefs = chart.get('colDefs'); if (!colDefs) return data; diff --git a/test/bug/issue-467-spec.js b/test/bug/issue-467-spec.js new file mode 100644 index 000000000..9ed26e175 --- /dev/null +++ b/test/bug/issue-467-spec.js @@ -0,0 +1,60 @@ +const expect = require('chai').expect; +const F2 = require('../../src/core'); +require('../../src/interaction/pan'); +require('../../src/geom/point'); +const Legend = require('../../src/plugin/legend'); +const data = require('../fixtures/cereal.json'); + +describe('Issue 467', () => { + let canvas; + let chart; + before(() => { + canvas = document.createElement('canvas'); + canvas.width = 300; + canvas.height = 300; + canvas.id = 'issue467'; + document.body.appendChild(canvas); + }); + + it('Issue 467', () => { + chart = new F2.Chart({ + id: 'issue467', + pixelRatio: window.devicePixelRatio, + plugins: Legend + }); + + chart.source(data); + chart.legend({ + position: 'bottom', + itemWidth: null, + align: 'center', + triggerOn: 'click' + }); + chart.filter('Manufacturer', val => { + return val === 'Kelloggs'; + }); + const point = chart.point().position('Calories*Potassium').color('Manufacturer') + .style({ + fillOpacity: 0.6 + }); + chart.interaction('pan', { + mode: 'xy' + }); + chart.render(); + + // 触发移动 + const interaction = chart._interactions.pan; + interaction._doMove(-80, 50); + + const shapes = point.get('container').get('children'); + // 移动之后过滤应该依然生效 + shapes.forEach(shape => { + expect(shape.attr('fill')).to.equal('#FACC14'); + }); + }); + + after(() => { + chart.destroy(); + document.body.removeChild(canvas); + }); +}); diff --git a/test/fixtures/cereal.json b/test/fixtures/cereal.json new file mode 100644 index 000000000..ace73c113 --- /dev/null +++ b/test/fixtures/cereal.json @@ -0,0 +1,1259 @@ +[{ + "Cereal Name": "100%_Bran", + "Manufacturer": "Nabisco", + "Type": "C", + "Calories": 70, + "Protein (g)": 4, + "Fat": 1, + "Sodium": 130, + "Dietary Fiber": 10, + "Carbs": 5, + "Sugars": 6, + "Display Shelf": 3, + "Potassium": 280, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.33 + }, + { + "Cereal Name": "100%_Natural_Bran", + "Manufacturer": "Quaker Oats", + "Type": "C", + "Calories": 120, + "Protein (g)": 3, + "Fat": 5, + "Sodium": 15, + "Dietary Fiber": 2, + "Carbs": 8, + "Sugars": 8, + "Display Shelf": 3, + "Potassium": 135, + "Vitamins and Minerals": 0, + "Serving Size Weight": 1, + "Cups per Serving": -1 + }, + { + "Cereal Name": "All-Bran", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 70, + "Protein (g)": 4, + "Fat": 1, + "Sodium": 260, + "Dietary Fiber": 9, + "Carbs": 7, + "Sugars": 5, + "Display Shelf": 3, + "Potassium": 320, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.33 + }, + { + "Cereal Name": "All-Bran_with_Extra_Fiber", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 50, + "Protein (g)": 4, + "Fat": 0, + "Sodium": 140, + "Dietary Fiber": 14, + "Carbs": 8, + "Sugars": 0, + "Display Shelf": 3, + "Potassium": 330, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.5 + }, + { + "Cereal Name": "Almond_Delight", + "Manufacturer": "Ralston Purina", + "Type": "C", + "Calories": 110, + "Protein (g)": 2, + "Fat": 2, + "Sodium": 200, + "Dietary Fiber": 1, + "Carbs": 14, + "Sugars": 8, + "Display Shelf": 3, + "Potassium": -1, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.75 + }, + { + "Cereal Name": "Apple_Cinnamon_Cheerios", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 110, + "Protein (g)": 2, + "Fat": 2, + "Sodium": 180, + "Dietary Fiber": 1.5, + "Carbs": 10.5, + "Sugars": 10, + "Display Shelf": 1, + "Potassium": 70, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.75 + }, + { + "Cereal Name": "Apple_Jacks", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 110, + "Protein (g)": 2, + "Fat": 0, + "Sodium": 125, + "Dietary Fiber": 1, + "Carbs": 11, + "Sugars": 14, + "Display Shelf": 2, + "Potassium": 30, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Basic_4", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 130, + "Protein (g)": 3, + "Fat": 2, + "Sodium": 210, + "Dietary Fiber": 2, + "Carbs": 18, + "Sugars": 8, + "Display Shelf": 3, + "Potassium": 100, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1.33, + "Cups per Serving": 0.75 + }, + { + "Cereal Name": "Bran_Chex", + "Manufacturer": "Ralston Purina", + "Type": "C", + "Calories": 90, + "Protein (g)": 2, + "Fat": 1, + "Sodium": 200, + "Dietary Fiber": 4, + "Carbs": 15, + "Sugars": 6, + "Display Shelf": 1, + "Potassium": 125, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.67 + }, + { + "Cereal Name": "Bran_Flakes", + "Manufacturer": "Post", + "Type": "C", + "Calories": 90, + "Protein (g)": 3, + "Fat": 0, + "Sodium": 210, + "Dietary Fiber": 5, + "Carbs": 13, + "Sugars": 5, + "Display Shelf": 3, + "Potassium": 190, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.67 + }, + { + "Cereal Name": "Cap'n'Crunch", + "Manufacturer": "Quaker Oats", + "Type": "C", + "Calories": 120, + "Protein (g)": 1, + "Fat": 2, + "Sodium": 220, + "Dietary Fiber": 0, + "Carbs": 12, + "Sugars": 12, + "Display Shelf": 2, + "Potassium": 35, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.75 + }, + { + "Cereal Name": "Cheerios", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 110, + "Protein (g)": 6, + "Fat": 2, + "Sodium": 290, + "Dietary Fiber": 2, + "Carbs": 17, + "Sugars": 1, + "Display Shelf": 1, + "Potassium": 105, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1.25 + }, + { + "Cereal Name": "Cinnamon_Toast_Crunch", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 120, + "Protein (g)": 1, + "Fat": 3, + "Sodium": 210, + "Dietary Fiber": 0, + "Carbs": 13, + "Sugars": 9, + "Display Shelf": 2, + "Potassium": 45, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.75 + }, + { + "Cereal Name": "Clusters", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 110, + "Protein (g)": 3, + "Fat": 2, + "Sodium": 140, + "Dietary Fiber": 2, + "Carbs": 13, + "Sugars": 7, + "Display Shelf": 3, + "Potassium": 105, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.5 + }, + { + "Cereal Name": "Cocoa_Puffs", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 110, + "Protein (g)": 1, + "Fat": 1, + "Sodium": 180, + "Dietary Fiber": 0, + "Carbs": 12, + "Sugars": 13, + "Display Shelf": 2, + "Potassium": 55, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Corn_Chex", + "Manufacturer": "Ralston Purina", + "Type": "C", + "Calories": 110, + "Protein (g)": 2, + "Fat": 0, + "Sodium": 280, + "Dietary Fiber": 0, + "Carbs": 22, + "Sugars": 3, + "Display Shelf": 1, + "Potassium": 25, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Corn_Flakes", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 100, + "Protein (g)": 2, + "Fat": 0, + "Sodium": 290, + "Dietary Fiber": 1, + "Carbs": 21, + "Sugars": 2, + "Display Shelf": 1, + "Potassium": 35, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Corn_Pops", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 110, + "Protein (g)": 1, + "Fat": 0, + "Sodium": 90, + "Dietary Fiber": 1, + "Carbs": 13, + "Sugars": 12, + "Display Shelf": 2, + "Potassium": 20, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Count_Chocula", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 110, + "Protein (g)": 1, + "Fat": 1, + "Sodium": 180, + "Dietary Fiber": 0, + "Carbs": 12, + "Sugars": 13, + "Display Shelf": 2, + "Potassium": 65, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Cracklin'_Oat_Bran", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 110, + "Protein (g)": 3, + "Fat": 3, + "Sodium": 140, + "Dietary Fiber": 4, + "Carbs": 10, + "Sugars": 7, + "Display Shelf": 3, + "Potassium": 160, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.5 + }, + { + "Cereal Name": "Cream_of_Wheat_(Quick)", + "Manufacturer": "Nabisco", + "Type": "H", + "Calories": 100, + "Protein (g)": 3, + "Fat": 0, + "Sodium": 80, + "Dietary Fiber": 1, + "Carbs": 21, + "Sugars": 0, + "Display Shelf": 2, + "Potassium": -1, + "Vitamins and Minerals": 0, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Crispix", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 110, + "Protein (g)": 2, + "Fat": 0, + "Sodium": 220, + "Dietary Fiber": 1, + "Carbs": 21, + "Sugars": 3, + "Display Shelf": 3, + "Potassium": 30, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Crispy_Wheat_&_Raisins", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 100, + "Protein (g)": 2, + "Fat": 1, + "Sodium": 140, + "Dietary Fiber": 2, + "Carbs": 11, + "Sugars": 10, + "Display Shelf": 3, + "Potassium": 120, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.75 + }, + { + "Cereal Name": "Double_Chex", + "Manufacturer": "Ralston Purina", + "Type": "C", + "Calories": 100, + "Protein (g)": 2, + "Fat": 0, + "Sodium": 190, + "Dietary Fiber": 1, + "Carbs": 18, + "Sugars": 5, + "Display Shelf": 3, + "Potassium": 80, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.75 + }, + { + "Cereal Name": "Froot_Loops", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 110, + "Protein (g)": 2, + "Fat": 1, + "Sodium": 125, + "Dietary Fiber": 1, + "Carbs": 11, + "Sugars": 13, + "Display Shelf": 2, + "Potassium": 30, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Frosted_Flakes", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 110, + "Protein (g)": 1, + "Fat": 0, + "Sodium": 200, + "Dietary Fiber": 1, + "Carbs": 14, + "Sugars": 11, + "Display Shelf": 1, + "Potassium": 25, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.75 + }, + { + "Cereal Name": "Frosted_Mini-Wheats", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 100, + "Protein (g)": 3, + "Fat": 0, + "Sodium": 0, + "Dietary Fiber": 3, + "Carbs": 14, + "Sugars": 7, + "Display Shelf": 2, + "Potassium": 100, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.8 + }, + { + "Cereal Name": "Fruitful_Bran", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 120, + "Protein (g)": 3, + "Fat": 0, + "Sodium": 240, + "Dietary Fiber": 5, + "Carbs": 14, + "Sugars": 12, + "Display Shelf": 3, + "Potassium": 190, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1.33, + "Cups per Serving": 0.67 + }, + { + "Cereal Name": "Fruity_Pebbles", + "Manufacturer": "Post", + "Type": "C", + "Calories": 110, + "Protein (g)": 1, + "Fat": 1, + "Sodium": 135, + "Dietary Fiber": 0, + "Carbs": 13, + "Sugars": 12, + "Display Shelf": 2, + "Potassium": 25, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.75 + }, + { + "Cereal Name": "Golden_Crisp", + "Manufacturer": "Post", + "Type": "C", + "Calories": 100, + "Protein (g)": 2, + "Fat": 0, + "Sodium": 45, + "Dietary Fiber": 0, + "Carbs": 11, + "Sugars": 15, + "Display Shelf": 1, + "Potassium": 40, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.88 + }, + { + "Cereal Name": "Golden_Grahams", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 110, + "Protein (g)": 1, + "Fat": 1, + "Sodium": 280, + "Dietary Fiber": 0, + "Carbs": 15, + "Sugars": 9, + "Display Shelf": 2, + "Potassium": 45, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.75 + }, + { + "Cereal Name": "Grape_Nuts_Flakes", + "Manufacturer": "Post", + "Type": "C", + "Calories": 100, + "Protein (g)": 3, + "Fat": 1, + "Sodium": 140, + "Dietary Fiber": 3, + "Carbs": 15, + "Sugars": 5, + "Display Shelf": 3, + "Potassium": 85, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.88 + }, + { + "Cereal Name": "Grape-Nuts", + "Manufacturer": "Post", + "Type": "C", + "Calories": 110, + "Protein (g)": 3, + "Fat": 0, + "Sodium": 170, + "Dietary Fiber": 3, + "Carbs": 17, + "Sugars": 3, + "Display Shelf": 3, + "Potassium": 90, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.25 + }, + { + "Cereal Name": "Great_Grains_Pecan", + "Manufacturer": "Post", + "Type": "C", + "Calories": 120, + "Protein (g)": 3, + "Fat": 3, + "Sodium": 75, + "Dietary Fiber": 3, + "Carbs": 13, + "Sugars": 4, + "Display Shelf": 3, + "Potassium": 100, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.33 + }, + { + "Cereal Name": "Honey_Graham_Ohs", + "Manufacturer": "Quaker Oats", + "Type": "C", + "Calories": 120, + "Protein (g)": 1, + "Fat": 2, + "Sodium": 220, + "Dietary Fiber": 1, + "Carbs": 12, + "Sugars": 11, + "Display Shelf": 2, + "Potassium": 45, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Honey_Nut_Cheerios", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 110, + "Protein (g)": 3, + "Fat": 1, + "Sodium": 250, + "Dietary Fiber": 1.5, + "Carbs": 11.5, + "Sugars": 10, + "Display Shelf": 1, + "Potassium": 90, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.75 + }, + { + "Cereal Name": "Honey-comb", + "Manufacturer": "Post", + "Type": "C", + "Calories": 110, + "Protein (g)": 1, + "Fat": 0, + "Sodium": 180, + "Dietary Fiber": 0, + "Carbs": 14, + "Sugars": 11, + "Display Shelf": 1, + "Potassium": 35, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1.33 + }, + { + "Cereal Name": "Just_Right_Crunchy__Nuggets", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 110, + "Protein (g)": 2, + "Fat": 1, + "Sodium": 170, + "Dietary Fiber": 1, + "Carbs": 17, + "Sugars": 6, + "Display Shelf": 3, + "Potassium": 60, + "Vitamins and Minerals": 100, + "Serving Size Weight": 1, + "Cups per Serving": -1 + }, + { + "Cereal Name": "Just_Right_Fruit_&_Nut", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 140, + "Protein (g)": 3, + "Fat": 1, + "Sodium": 170, + "Dietary Fiber": 2, + "Carbs": 20, + "Sugars": 9, + "Display Shelf": 3, + "Potassium": 95, + "Vitamins and Minerals": 100, + "Serving Size Weight": 1.3, + "Cups per Serving": 0.75 + }, + { + "Cereal Name": "Kix", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 110, + "Protein (g)": 2, + "Fat": 1, + "Sodium": 260, + "Dietary Fiber": 0, + "Carbs": 21, + "Sugars": 3, + "Display Shelf": 2, + "Potassium": 40, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1.5 + }, + { + "Cereal Name": "Life", + "Manufacturer": "Quaker Oats", + "Type": "C", + "Calories": 100, + "Protein (g)": 4, + "Fat": 2, + "Sodium": 150, + "Dietary Fiber": 2, + "Carbs": 12, + "Sugars": 6, + "Display Shelf": 2, + "Potassium": 95, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.67 + }, + { + "Cereal Name": "Lucky_Charms", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 110, + "Protein (g)": 2, + "Fat": 1, + "Sodium": 180, + "Dietary Fiber": 0, + "Carbs": 12, + "Sugars": 12, + "Display Shelf": 2, + "Potassium": 55, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Maypo", + "Manufacturer": "American Home Food Products", + "Type": "H", + "Calories": 100, + "Protein (g)": 4, + "Fat": 1, + "Sodium": 0, + "Dietary Fiber": 0, + "Carbs": 16, + "Sugars": 3, + "Display Shelf": 2, + "Potassium": 95, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": -1 + }, + { + "Cereal Name": "Mueslix_Crispy_Blend", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 160, + "Protein (g)": 3, + "Fat": 2, + "Sodium": 150, + "Dietary Fiber": 3, + "Carbs": 17, + "Sugars": 13, + "Display Shelf": 3, + "Potassium": 160, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1.5, + "Cups per Serving": 0.67 + }, + { + "Cereal Name": "Multi-Grain_Cheerios", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 100, + "Protein (g)": 2, + "Fat": 1, + "Sodium": 220, + "Dietary Fiber": 2, + "Carbs": 15, + "Sugars": 6, + "Display Shelf": 1, + "Potassium": 90, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Nut&Honey_Crunch", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 120, + "Protein (g)": 2, + "Fat": 1, + "Sodium": 190, + "Dietary Fiber": 0, + "Carbs": 15, + "Sugars": 9, + "Display Shelf": 2, + "Potassium": 40, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.67 + }, + { + "Cereal Name": "Nutri-Grain_Almond-Raisin", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 140, + "Protein (g)": 3, + "Fat": 2, + "Sodium": 220, + "Dietary Fiber": 3, + "Carbs": 21, + "Sugars": 7, + "Display Shelf": 3, + "Potassium": 130, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1.33, + "Cups per Serving": 0.67 + }, + { + "Cereal Name": "Nutri-grain_Wheat", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 90, + "Protein (g)": 3, + "Fat": 0, + "Sodium": 170, + "Dietary Fiber": 3, + "Carbs": 18, + "Sugars": 2, + "Display Shelf": 3, + "Potassium": 90, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": -1 + }, + { + "Cereal Name": "Oatmeal_Raisin_Crisp", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 130, + "Protein (g)": 3, + "Fat": 2, + "Sodium": 170, + "Dietary Fiber": 1.5, + "Carbs": 13.5, + "Sugars": 10, + "Display Shelf": 3, + "Potassium": 120, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1.25, + "Cups per Serving": 0.5 + }, + { + "Cereal Name": "Post_Nat._Raisin_Bran", + "Manufacturer": "Post", + "Type": "C", + "Calories": 120, + "Protein (g)": 3, + "Fat": 1, + "Sodium": 200, + "Dietary Fiber": 6, + "Carbs": 11, + "Sugars": 14, + "Display Shelf": 3, + "Potassium": 260, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1.33, + "Cups per Serving": 0.67 + }, + { + "Cereal Name": "Product_19", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 100, + "Protein (g)": 3, + "Fat": 0, + "Sodium": 320, + "Dietary Fiber": 1, + "Carbs": 20, + "Sugars": 3, + "Display Shelf": 3, + "Potassium": 45, + "Vitamins and Minerals": 100, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Puffed_Rice", + "Manufacturer": "Quaker Oats", + "Type": "C", + "Calories": 50, + "Protein (g)": 1, + "Fat": 0, + "Sodium": 0, + "Dietary Fiber": 0, + "Carbs": 13, + "Sugars": 0, + "Display Shelf": 3, + "Potassium": 15, + "Vitamins and Minerals": 0, + "Serving Size Weight": 0.5, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Puffed_Wheat", + "Manufacturer": "Quaker Oats", + "Type": "C", + "Calories": 50, + "Protein (g)": 2, + "Fat": 0, + "Sodium": 0, + "Dietary Fiber": 1, + "Carbs": 10, + "Sugars": 0, + "Display Shelf": 3, + "Potassium": 50, + "Vitamins and Minerals": 0, + "Serving Size Weight": 0.5, + "Cups per Serving": -1 + }, + { + "Cereal Name": "Quaker_Oat_Squares", + "Manufacturer": "Quaker Oats", + "Type": "C", + "Calories": 100, + "Protein (g)": 4, + "Fat": 1, + "Sodium": 135, + "Dietary Fiber": 2, + "Carbs": 14, + "Sugars": 6, + "Display Shelf": 3, + "Potassium": 110, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.5 + }, + { + "Cereal Name": "Quaker_Oatmeal", + "Manufacturer": "Quaker Oats", + "Type": "H", + "Calories": 100, + "Protein (g)": 5, + "Fat": 2, + "Sodium": 0, + "Dietary Fiber": 2.7, + "Carbs": -1, + "Sugars": -1, + "Display Shelf": 1, + "Potassium": 110, + "Vitamins and Minerals": 0, + "Serving Size Weight": 1, + "Cups per Serving": 0.67 + }, + { + "Cereal Name": "Raisin_Bran", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 120, + "Protein (g)": 3, + "Fat": 1, + "Sodium": 210, + "Dietary Fiber": 5, + "Carbs": 14, + "Sugars": 12, + "Display Shelf": 2, + "Potassium": 240, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1.33, + "Cups per Serving": 0.75 + }, + { + "Cereal Name": "Raisin_Nut_Bran", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 100, + "Protein (g)": 3, + "Fat": 2, + "Sodium": 140, + "Dietary Fiber": 2.5, + "Carbs": 10.5, + "Sugars": 8, + "Display Shelf": 3, + "Potassium": 140, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.5 + }, + { + "Cereal Name": "Raisin_Squares", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 90, + "Protein (g)": 2, + "Fat": 0, + "Sodium": 0, + "Dietary Fiber": 2, + "Carbs": 15, + "Sugars": 6, + "Display Shelf": 3, + "Potassium": 110, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.5 + }, + { + "Cereal Name": "Rice_Chex", + "Manufacturer": "Ralston Purina", + "Type": "C", + "Calories": 110, + "Protein (g)": 1, + "Fat": 0, + "Sodium": 240, + "Dietary Fiber": 0, + "Carbs": 23, + "Sugars": 2, + "Display Shelf": 1, + "Potassium": 30, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1.13 + }, + { + "Cereal Name": "Rice_Krispies", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 110, + "Protein (g)": 2, + "Fat": 0, + "Sodium": 290, + "Dietary Fiber": 0, + "Carbs": 22, + "Sugars": 3, + "Display Shelf": 1, + "Potassium": 35, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Shredded_Wheat", + "Manufacturer": "Nabisco", + "Type": "C", + "Calories": 80, + "Protein (g)": 2, + "Fat": 0, + "Sodium": 0, + "Dietary Fiber": 3, + "Carbs": 16, + "Sugars": 0, + "Display Shelf": 1, + "Potassium": 95, + "Vitamins and Minerals": 0, + "Serving Size Weight": 0.83, + "Cups per Serving": -1 + }, + { + "Cereal Name": "Shredded_Wheat_'n'Bran", + "Manufacturer": "Nabisco", + "Type": "C", + "Calories": 90, + "Protein (g)": 3, + "Fat": 0, + "Sodium": 0, + "Dietary Fiber": 4, + "Carbs": 19, + "Sugars": 0, + "Display Shelf": 1, + "Potassium": 140, + "Vitamins and Minerals": 0, + "Serving Size Weight": 1, + "Cups per Serving": 0.67 + }, + { + "Cereal Name": "Shredded_Wheat_spoon_size", + "Manufacturer": "Nabisco", + "Type": "C", + "Calories": 90, + "Protein (g)": 3, + "Fat": 0, + "Sodium": 0, + "Dietary Fiber": 3, + "Carbs": 20, + "Sugars": 0, + "Display Shelf": 1, + "Potassium": 120, + "Vitamins and Minerals": 0, + "Serving Size Weight": 1, + "Cups per Serving": 0.67 + }, + { + "Cereal Name": "Smacks", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 110, + "Protein (g)": 2, + "Fat": 1, + "Sodium": 70, + "Dietary Fiber": 1, + "Carbs": 9, + "Sugars": 15, + "Display Shelf": 2, + "Potassium": 40, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.75 + }, + { + "Cereal Name": "Special_K", + "Manufacturer": "Kelloggs", + "Type": "C", + "Calories": 110, + "Protein (g)": 6, + "Fat": 0, + "Sodium": 230, + "Dietary Fiber": 1, + "Carbs": 16, + "Sugars": 3, + "Display Shelf": 1, + "Potassium": 55, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Strawberry_Fruit_Wheats", + "Manufacturer": "Nabisco", + "Type": "C", + "Calories": 90, + "Protein (g)": 2, + "Fat": 0, + "Sodium": 15, + "Dietary Fiber": 3, + "Carbs": 15, + "Sugars": 5, + "Display Shelf": 2, + "Potassium": 90, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": -1 + }, + { + "Cereal Name": "Total_Corn_Flakes", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 110, + "Protein (g)": 2, + "Fat": 1, + "Sodium": 200, + "Dietary Fiber": 0, + "Carbs": 21, + "Sugars": 3, + "Display Shelf": 3, + "Potassium": 35, + "Vitamins and Minerals": 100, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Total_Raisin_Bran", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 140, + "Protein (g)": 3, + "Fat": 1, + "Sodium": 190, + "Dietary Fiber": 4, + "Carbs": 15, + "Sugars": 14, + "Display Shelf": 3, + "Potassium": 230, + "Vitamins and Minerals": 100, + "Serving Size Weight": 1.5, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Total_Whole_Grain", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 100, + "Protein (g)": 3, + "Fat": 1, + "Sodium": 200, + "Dietary Fiber": 3, + "Carbs": 16, + "Sugars": 3, + "Display Shelf": 3, + "Potassium": 110, + "Vitamins and Minerals": 100, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Triples", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 110, + "Protein (g)": 2, + "Fat": 1, + "Sodium": 250, + "Dietary Fiber": 0, + "Carbs": 21, + "Sugars": 3, + "Display Shelf": 3, + "Potassium": 60, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.75 + }, + { + "Cereal Name": "Trix", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 110, + "Protein (g)": 1, + "Fat": 1, + "Sodium": 140, + "Dietary Fiber": 0, + "Carbs": 13, + "Sugars": 12, + "Display Shelf": 2, + "Potassium": 25, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Wheat_Chex", + "Manufacturer": "Ralston Purina", + "Type": "C", + "Calories": 100, + "Protein (g)": 3, + "Fat": 1, + "Sodium": 230, + "Dietary Fiber": 3, + "Carbs": 17, + "Sugars": 3, + "Display Shelf": 1, + "Potassium": 115, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.67 + }, + { + "Cereal Name": "Wheaties", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 100, + "Protein (g)": 3, + "Fat": 1, + "Sodium": 200, + "Dietary Fiber": 3, + "Carbs": 17, + "Sugars": 3, + "Display Shelf": 1, + "Potassium": 110, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 1 + }, + { + "Cereal Name": "Wheaties_Honey_Gold", + "Manufacturer": "General Mills", + "Type": "C", + "Calories": 110, + "Protein (g)": 2, + "Fat": 1, + "Sodium": 200, + "Dietary Fiber": 1, + "Carbs": 16, + "Sugars": 8, + "Display Shelf": 1, + "Potassium": 60, + "Vitamins and Minerals": 25, + "Serving Size Weight": 1, + "Cups per Serving": 0.75 + } +]