Giter Club home page Giter Club logo

power-fx-host-samples's Introduction

Microsoft Power Fx Host Samples

This repo contains samples that exercise Power Fx.

These samples depend on the sources and packages from https://github.com/microsoft/Power-Fx.

Each sample is in it's own directory under Samples and self contained. Check the README.md for each. Most will include a Visual Studio solution file for each building.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

power-fx-host-samples's People

Contributors

dependabot[bot] avatar gregli-msft avatar henrystaples avatar jas-valgotar avatar lucgenetier avatar microsoftopensource avatar mikestall avatar vvijayalakshmi21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

power-fx-host-samples's Issues

Mac OS: The type initializer for 'Microsoft.PowerFx.Core.Texl.BuiltinFunctionsCore' threw an exception

I've been trying these samples on macOS 11.6.1
I am using .Net: 6.0.101

but I get the following error trying the WebDemo and ConsoleREPL:

The type initializer for 'Microsoft.PowerFx.Core.Texl.BuiltinFunctionsCore' threw an exception

To fix the issue, I've locally modified the samples taking inspiration from microsoft/Power-Fx#71 (comment)

ConsoleREPL

To fix the issue I've added:

CultureInfo.CurrentCulture = new CultureInfo("en-US");

before this ResetEngine(); line:

public static void Main()
{
ResetEngine();

Before:

image

After:

image

Web

Since I could not find ASP.Net redistributable for .Net Core 3.1 for Mac OS X,
I've replaced this line:

<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>

to read

    <TargetFramework>netcoreapp6.0</TargetFramework>

instead.

Then, I've changed this line:

public RecalcEngine GetEngine()
{
// If the engine requires additional symbols to load, server
// should find a way to safely cache it.
var engine = new RecalcEngine();

to read:

        public RecalcEngine GetEngine()
        {
            // If the engine requires additional symbols to load, server
            // should find a way to safely cache it.
            CultureInfo.CurrentCulture = new CultureInfo("en-US");
            var engine = new RecalcEngine();

instead.

Please notice I've tried to just pass new CultureInfo("en-US") as an argument to the RecalcEngine constructor, but that didn't solve ๐Ÿคท

Pardon me if there is a simpler solution but I'm very new to .Net! ๐Ÿ˜†

The above solves for me on Mac OS.
Before:
Screenshot 2021-12-29 at 11 11 02

After:
Screenshot 2021-12-29 at 14 24 44

app fails on macOS

what a great sample! It builds and runs perfectly on Windows, but not so on mac catalina.

the service builds and runs. I had a problem with the app. it showed a "failed to find WebAssembly" message when i issued "npm start" command.

solution: node does not run alongside graalvm. After removing graal, the app shows the page at port 3000.

however, the page is not functional, there is no intellisense and no evaluation.

mistake double quotation for Help() Command

image

I think this is the best case:

Record syntax is { < field >: < value >, ... } without quoted field names.
    Example: { Name: "Joe", Age: 29 }
Use the Table function for a list of records.  
    Example: Table( { Name: "Joe" }, { Name: "Sally" } )
Use [ <value>, ... ] for a single column table, field name is "Value".
    Examples: [ 1, 2, 3 ] 
Records and Tables can be arbitrarily nested.

image
Why we need format this StringValue?

TransformFx sample fails

The TableTransform fails because the field name "Name" is used in the record twice. Replacing second Name: in the yaml with a different field name solves this.

Diff: = Score2 - Score
Name&Diff: = Name & Diff
Total: = PreviousRecord.Total + Score
RowDiff: = Score - PreviousRecord.Score

Name,Score,Score2,Diff,Name&Diff,Total,RowDiff

Blazor example

Hi guys, any plan to have an example Power-Fx running on Blazor

Formula bar autocomplete within Fluent UI Panel

I'm not sure if this should be directed to the Fluent UI or Monaco teams instead, please advise if so.

I'm trying to host the formula bar within a Fluent UI <Panel> control. The formula bar appears as expected, but the autocomplete list does not appear. To repro, edit the PowerFxDemoPage.tsx component, add the import:

import { Panel } from '@fluentui/react/lib/Panel';

and wrap the entire contents of the component in a <Panel>:

<div>
  <Panel isOpen={true}>
    <h3>Context</h3>
    ...
    <FetchData />
  </Panel>
</div>

React version dependency in @microsoft/power-fx-formulabar

I am starting to work with the formula bar and want to work it into my own react apps. However, when I try to force the npm install, I am seeing a dependency error:

npm ERR! Could not resolve dependency: npm ERR! peer react@">=16.3.2-0 <17.0.0" from @microsoft/[email protected] npm ERR! node_modules/@microsoft/power-fx-formulabar npm ERR! @microsoft/power-fx-formulabar@"*" from the root project

I have re-run the install with --force and so far I am not hitting any roadblocks (actual installed React v is 17.0.2) but the control should be supporting something at least close to most recent React ver (which is over 18 now).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.