-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #837 from explorable-viz/linked-inputs
Move `slicing/motivating-example.fld` to `linked-inputs/water.fld` and run using (in-progress) linked inputs test helper
- Loading branch information
Showing
16 changed files
with
102 additions
and
181 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
18 changes: 9 additions & 9 deletions
18
fluid/example/slicing/motivating-example.fld → fluid/example/linked-inputs/water.fld
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
let country_water countries_list cities c_name = | ||
let city_water = sum [city.water | country <- countries_list | ||
, c_name == country.name | ||
, city <- cities | ||
, elem city.name country.cities]; | ||
farm_water = sum [ country.farms * 3 | country <- countries_list, country.name == c_name ] | ||
in city_water + farm_water; | ||
let all_countries = [{name: "Germany", cities: ["Berlin", "Hamburg", "Munich"], farms: 100}, | ||
{name: "UK", cities: ["London", "Birmingham", "Manchester"], farms: 200}]; | ||
let all_cities = [ | ||
all_cities = [ | ||
{name: "Berlin", water: 130}, | ||
{name: "Munich", water: 80}, | ||
{name: "Hamburg", water: 60}, | ||
{name: "London", water: 200}, | ||
{name: "Birmingham", water: 50}, | ||
{name: "Manchester", water: 35} | ||
]; | ||
let all_waters countries cities = | ||
let country_water countries_list cities c_name = | ||
let city_water = sum [city.water | country <- countries_list | ||
, c_name == country.name | ||
, city <- cities | ||
, elem city.name country.cities]; | ||
farm_water = sum [ country.farms * 3 | country <- countries_list, country.name == c_name ] | ||
in city_water + farm_water; | ||
let all_waters countries cities = | ||
let c_names = [country.name | country <- countries] | ||
in map (country_water countries cities) c_names | ||
in all_waters all_countries all_cities |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
let totalFor country = | ||
let totalFor country = | ||
sum [row.cities + row.farms + row.industry + row.energy | row <- data, row.country == country]; | ||
let countryData = [ {x: country.country, y: totalFor country.country} | ||
| country <- data] | ||
in BarChart { | ||
caption: "Total Water Consumption By Country", | ||
data: countryData | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[ | ||
{country: "Germany", cities: 900, farms: 150, industry:500 , energy: 450, popMil: 81}, | ||
{country: "UK", cities: 800, farms: 200, industry: 400, energy: 700, popMil: 67} | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,19 @@ | ||
module PLDI2024 where | ||
|
||
import Prelude hiding (absurd) | ||
|
||
import App.Fig (FigSpec, LinkedOutputsFigSpec, drawFiles, drawFigs, drawLinkedOutputsFigs, loadFig, loadLinkedOutputsFig) | ||
import Prelude | ||
import App.Fig (LinkedOutputsFigSpec, drawLinkedOutputsFigs, loadLinkedOutputsFig) | ||
import Effect (Effect) | ||
import Module (File(..), Folder(..)) | ||
import Util ((×)) | ||
import Module (File(..)) | ||
|
||
-- Will changes to PLDI figures but for now same as those on f.luid.org main page. | ||
linkedOutputsFig1 :: LinkedOutputsFigSpec | ||
linkedOutputsFig1 = | ||
waterFig :: LinkedOutputsFigSpec | ||
waterFig = | ||
{ divId: "fig-1" | ||
, file1: File "water-bar-chart" | ||
, file2: File "water-ratio-chart" | ||
, dataFile: File "water-consumption-data" | ||
, x: "data" | ||
} | ||
|
||
fig1 :: FigSpec | ||
fig1 = | ||
{ divId: "fig-conv-1" | ||
, file: File "slicing/convolution/emboss" | ||
, xs: [ "image", "filter" ] | ||
} | ||
|
||
fig2 :: FigSpec | ||
fig2 = | ||
{ divId: "fig-conv-2" | ||
, file: File "slicing/convolution/emboss-wrap" | ||
, xs: [ "image", "filter" ] | ||
} | ||
|
||
main :: Effect Unit | ||
main = do | ||
drawFiles [ Folder "fluid/lib" × File "convolution" ] | ||
drawFigs [ loadFig fig1, loadFig fig2 ] | ||
drawLinkedOutputsFigs [ loadLinkedOutputsFig linkedOutputsFig1 ] | ||
drawLinkedOutputsFigs [ loadLinkedOutputsFig waterFig ] |
Oops, something went wrong.